[
https://issues.apache.org/jira/browse/DRILL-4574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15223179#comment-15223179
]
ASF GitHub Bot commented on DRILL-4574:
---------------------------------------
GitHub user baunz opened a pull request:
https://github.com/apache/drill/pull/459
DRILL-4574: Avro Plugin: Flatten does not work correctly on record items
See https://issues.apache.org/jira/browse/DRILL-4574
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/baunz/drill DRILL-4574
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/459.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #459
----
commit 70660286877728232bcdfb76db11ca2261660af0
Author: baunz <[email protected]>
Date: 2016-04-03T07:43:40Z
Add test cases for primitive and optional complex array
----
> Avro Plugin: Flatten does not work correctly on record items
> ------------------------------------------------------------
>
> Key: DRILL-4574
> URL: https://issues.apache.org/jira/browse/DRILL-4574
> Project: Apache Drill
> Issue Type: Bug
> Components: Storage - Avro
> Affects Versions: 1.6.0
> Reporter: Johannes Schulte
> Priority: Minor
>
> If the schema looks like this:
> {code}
> {
> "type" : "record",
> "name" : "MainRecord",
> "namespace" : "drizz.WriteAvroTestFileForDrill$",
> "fields" : [ {
> "name" : "elements",
> "type" : {
> "type" : "array",
> "items" : {
> "type" : "record",
> "name" : "NestedRecord",
> "fields" : [ {
> "name" : "field1",
> "type" : "int"
> } ]
> },
> "java-class" : "java.util.List"
> }
> } ]
> }
> {code}
> and the contents looks like this (according to avro tojson command line
> utility)
> {code}
> {"elements":[{"field1":0},{"field1":1},{"field1":2},{"field1":3},{"field1":4},{"field1":5},{"field1":6},{"field1":7},{"field1":8},{"field1":9}]}
> {"elements":[{"field1":0},{"field1":1},{"field1":2},{"field1":3},{"field1":4},{"field1":5},{"field1":6},{"field1":7},{"field1":8},{"field1":9}]}
> {code}
> a query like
> select flatten(elements) from
> dfs.`/Users/j.schulte/data/avro-drill/no-union/`;
> yields exactly two rows:
> {code}
> +---------------+
> | EXPR$0 |
> +---------------+
> | {"field1":9} |
> | {"field1":9} |
> +---------------+
> {code}
> as if only the last element in the array would survive.
> It works for primitive arrays.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)