Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-2186

avro::Exception string gives the incorrect message

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.8.2
    • 1.9.0
    • c++
    • None
    • Linux bream 2.6.39-200.24.1.el6uek.x86_64 #1 SMP Sat Jun 23 02:39:07 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux
      

       

    Description

      When a field specified in schema is missing and we call avro::encode on the data. It throws an exception, which is as expected. But the issue is with the error message. It comes the other way round.

      Schema:

      {
       "type" : "record",
       "name" : "userInfo",
       "fields" : [
          { "name" : "id", "type" : "int"},
          { "name" : "fullName", "type" : "string" }
       ]
      }
      

      The generic datum to be encoded has no "id" provided. There is an empty GenericDatum for that field. Here is the excetion that is thrown:

      avro::Exception caught: Invalid operation. Expected: Null got Int

      The exception message should have been 
      avro::Exception caught: Invalid operation. Expected: Int got Null

       

      Please let us know if you need more information on this.

      Attachments

        Activity

          People

            thiru_mg Thiruvalluvan M. G.
            Anubhav_CSG Anubhav Siddharth
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: