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

Making Avro serialization error message more actionable with schema name and field name

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.6.3, 1.9.0, 1.8.2
    • Fix Version/s: 1.10.0
    • Component/s: java
    • Labels:
      None

      Description

      In certain scenarios when there is a serialization error, avro serializer gives following error messages that are not actionable without any schema name and/field name in it.

      • java.lang.Double cannot be cast to java.lang.Long
      • Not an enum: null
      • ClassCastException 
      • ..

      If there is a filed name of specific schema that is causing these serialization errors, that helps to fix such issues quickly.

       

      Proposed Changes:

      The "writeWithoutConversion" method of "GenericDatumWriter"  class can be updated to handle "ClassCastException" along with "NullPointerException" to throw an exception with schema name and field name.

      The "writeEnum", "writeField", and "error" method can be enhanced to add field names so that error message can have the field that is causing the issue.

       

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jmudda Jagannathrao Mudda
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: