Richard Henderson created DRILL-4594:
----------------------------------------

             Summary: Incorrect results when querying AVRO data with record and 
array in schema
                 Key: DRILL-4594
                 URL: https://issues.apache.org/jira/browse/DRILL-4594
             Project: Apache Drill
          Issue Type: Bug
          Components: Storage - Avro
    Affects Versions: 1.6.0
            Reporter: Richard Henderson


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"}}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to