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

Timothy Farkas commented on DRILL-6606:
---------------------------------------

So after fixing the first issue, another issue popped up. The correct types are 
propagated through the operators, but are lost in the last project operator in 
the plan

{code}
00-01      ProjectAllowDup(l_quantity=[$0], l_shipdate=[$1], o_custkey=[$2])
00-02        Project(l_quantity=[ITEM($0, 'l_quantity')], l_shipdate=[ITEM($0, 
'l_shipdate')], o_custkey=[ITEM($2, 'o_custkey')])
00-03          HashJoin(condition=[=($1, $3)], joinType=[inner])
00-04            Project(T3¦¦**=[$0], $f10=[$1])
00-06              Project(T3¦¦**=[$0], $f1=[ITEM($0, 'o_orderkey')])
00-08                SelectionVectorRemover
00-10                  Limit(fetch=[0])
00-12                    Project(T3¦¦**=[$0])
00-14                      Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=classpath:/tpch/orders.parquet]], 
selectionRoot=classpath:/tpch/orders.parquet, numFiles=1, numRowGroups=1, 
usedMetadataFile=false, columns=[`**`]]])
00-05            Project(T2¦¦**=[$0], $f1=[ITEM($0, 'l_orderkey')])
00-07              SelectionVectorRemover
00-09                Limit(fetch=[0])
00-11                  Project(T2¦¦**=[$0])
00-13                    Scan(groupscan=[ParquetGroupScan 
[entries=[ReadEntryWithPath [path=classpath:/tpch/lineitem.parquet]], 
selectionRoot=classpath:/tpch/lineitem.parquet, numFiles=1, numRowGroups=1, 
usedMetadataFile=false, columns=[`**`]]])
{code}

I am doing more investigation for this.

> Hash Join returns incorrect data types when joining subqueries with limit 0
> ---------------------------------------------------------------------------
>
>                 Key: DRILL-6606
>                 URL: https://issues.apache.org/jira/browse/DRILL-6606
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Bohdan Kazydub
>            Assignee: Timothy Farkas
>            Priority: Blocker
>             Fix For: 1.14.0
>
>
> PreparedStatement for query
> {code:sql}
> SELECT l.l_quantity, l.l_shipdate, o.o_custkey
> FROM (SELECT * FROM cp.`tpch/lineitem.parquet` LIMIT 0) l
>     JOIN (SELECT * FROM cp.`tpch/orders.parquet` LIMIT 0) o 
>     ON l.l_orderkey = o.o_orderkey
> LIMIT 0
> {code}
>  is created with wrong types (nullable INTEGER) for all selected columns, no 
> matter what their actual type is. This behavior reproduces with hash join 
> only and is very likely to be caused by DRILL-6027 as the query works fine 
> before this feature was implemented.
> To reproduce the problem you can put the aforementioned query into 
> TestPreparedStatementProvider#joinOrderByQuery() test method.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to