[
https://issues.apache.org/jira/browse/DRILL-4693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15301197#comment-15301197
]
ASF GitHub Bot commented on DRILL-4693:
---------------------------------------
GitHub user amansinha100 opened a pull request:
https://github.com/apache/drill/pull/508
DRILL-4693: Ensure final column re-ordering is done if any select li…
…st expression is convert_fromjson.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/amansinha100/incubator-drill DRILL-4693
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/drill/pull/508.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 #508
----
commit eaf411c08329376cc8f185726b7b6db1cc8462e2
Author: Aman Sinha <[email protected]>
Date: 2016-05-25T22:33:56Z
DRILL-4693: Ensure final column re-ordering is done if any select list
expression is convert_fromjson.
----
> Incorrect column ordering when CONVERT_FROM() json is used
> -----------------------------------------------------------
>
> Key: DRILL-4693
> URL: https://issues.apache.org/jira/browse/DRILL-4693
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Relational Operators, Query Planning &
> Optimization
> Affects Versions: 1.6.0
> Reporter: Aman Sinha
> Assignee: Aman Sinha
>
> For the following query, the column order in the results is wrong..it should
> be col1, col2, col3.
> {noformat}
> 0: jdbc:drill:zk=local> select 'abc' as col1, convert_from('{"x" : "y"}',
> 'json') as col2, 'xyz' as col3 from cp.`tpch/region.parquet`;
> +-------+-------+------------+
> | col1 | col3 | col2 |
> +-------+-------+------------+
> | abc | xyz | {"x":"y"} |
> | abc | xyz | {"x":"y"} |
> | abc | xyz | {"x":"y"} |
> | abc | xyz | {"x":"y"} |
> | abc | xyz | {"x":"y"} |
> +-------+-------+------------+
> {noformat}
> The EXPLAIN plan:
> {noformat}
> 0: jdbc:drill:zk=local> explain plan for select 'abc' as col1,
> convert_from('{"x" : "y"}', 'json') as col2, 'xyz' as col3 from
> cp.`tpch/region.parquet`;
> +------+------+
> | text | json |
> +------+------+
> | 00-00 Screen
> 00-01 Project(col1=['abc'], col2=[CONVERT_FROMJSON('{"x" : "y"}')],
> col3=['xyz'])
> 00-02 Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath
> [path=classpath:/tpch/region.parquet]],
> selectionRoot=classpath:/tpch/region.parquet, numFiles=1,
> usedMetadataFile=false, columns=[]]])
> {noformat}
> This happens on current master branch as well as 1.6.0 and even earlier (I
> checked 1.4.0 as well which also has the same behavior). So it is a
> pre-existing bug.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)