drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chun Chang (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-4693) Incorrect column ordering when CONVERT_FROM() json is used
Date Wed, 13 Jul 2016 00:34:20 GMT

    [ https://issues.apache.org/jira/browse/DRILL-4693?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15374067#comment-15374067
] 

Chun Chang commented on DRILL-4693:
-----------------------------------

verified.

{noformat}
0: jdbc:drill:schema=dfs.drillTestDir> select 'abc' as col1, convert_from('{"x" : "y"}',
'json') as col2, 'xyz' as col3 from cp.`tpch/region.parquet`;
+-------+------------+-------+
| col1  |    col2    | col3  |
+-------+------------+-------+
| abc   | {"x":"y"}  | xyz   |
| abc   | {"x":"y"}  | xyz   |
| abc   | {"x":"y"}  | xyz   |
| abc   | {"x":"y"}  | xyz   |
| abc   | {"x":"y"}  | xyz   |
+-------+------------+-------+
5 rows selected (0.938 seconds)
0: jdbc:drill:schema=dfs.drillTestDir> select * from sys.version;
+-----------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------+----------------------------+---------------------+----------------------------+
|     version     |                 commit_id                 |                          
                      commit_message                                                  |  
     commit_time         |     build_email     |         build_time         |
+-----------------+-------------------------------------------+-----------------------------------------------------------------------------------------------------------------+----------------------------+---------------------+----------------------------+
| 1.8.0-SNAPSHOT  | 05c42eae79ce3e309028b3824f9449b98e329f29  | DRILL-4707: Fix memory leak
or incorrect query result in case two column names are case-insensitive identical.  | 29.06.2016
@ 08:15:13 PDT  | inramana@gmail.com  | 07.07.2016 @ 10:51:08 PDT  |
{noformat}


> 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
>             Fix For: 1.7.0
>
>
> 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)

Mime
View raw message