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

C# Logical Types throw exception on unknown logical type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.9.2
    • None
    • csharp

    Description

      In the C# avro implementation of logical types, the logical type functionality throws an exception whenever the an unknown logical type is used. The LogicalTypeFacory implements a boolean to ignore this exception, however, the calling function forces the exception to be thrown.

      LogicalSchema calling function: https://github.com/apache/avro/blob/75e8f58c95e2b8c69af1a6f60c35a848a6781f0c/lang/csharp/src/apache/main/Schema/LogicalSchema.cs#L58

      LogicalTypeFactory: https://github.com/apache/avro/blob/8199b9626e4badd34a85946cd223a91863f44cee/lang/csharp/src/apache/main/Util/LogicalTypeFactory.cs 

       

      According to the AVRO spec:

      Language implementations must ignore unknown logical types when reading, and should use the underlying Avro type. If a logical type is invalid, for example a decimal with scale greater than its precision, then implementations should ignore the logical type and use the underlying Avro type. (https://avro.apache.org/docs/1.9.2/spec.html#Logical+Types)

      So this functionality should not throw an exception when encountering an unknown type and instead use the underlying type.

      Attachments

        Activity

          People

            Unassigned Unassigned
            wmpickett William Pickett
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 4h 40m
                4h 40m