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

avro::Exception string gives the incorrect message

    Details

    • Type: Bug
    • Status: Open
    • Priority: Critical
    • Resolution: Unresolved
    • Affects Version/s: 1.8.2
    • Fix Version/s: None
    • Component/s: c++
    • Labels:
      None
    • Environment:
      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

            • Assignee:
              Unassigned
              Reporter:
              Anubhav_CSG Anubhav Siddharth
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: