Uploaded image for project: 'Apache Drill'
  1. Apache Drill
  2. DRILL-4594

Incorrect results when querying AVRO data with record and array in schema

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.6.0
    • None
    • Storage - Avro
    • None

    Description

      When querying avro data, if the schema has a record before the array, then the results are incorrect.

      Schema:
      { "c_record":

      {"nested_c_string": "str0"}

      , "d_array": [

      {"nested_d_string": "str0"}

      ]}

      Query:
      select t.c_record, t.d_array[0].nested_d_string from dfs_test.`file.avro` t;

      Expected Result:

      {"nested_c_string":"str0"}

      str0

      Actual Result:
      {"nested_c_string":"str0","d_array":[

      {"nested_d_string":"str0"}

      ]} null

      As you can see, the result is incorrect. This issue seems to happen only when a record is included before an array in the avro schema.

      However, if the array is included before the record, then the query returns the correct result. Refer to the following schema:
      { "d_array": [

      {"nested_d_string": "str0"}

      ], "c_record": {"nested_c_string": "str0"}}

      Attachments

        Activity

          People

            Unassigned Unassigned
            richard.henderson@truvenhealth.com Richard Henderson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: