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

Jesus Camacho Rodriguez commented on HIVE-22824:
------------------------------------------------

A couple of comments:
- Can we add a test case for the issue? Currently the following seems to fail:
{code}
CREATE TABLE table1 (a INT, b INT);
INSERT INTO table1 VALUES (1, 2), (1, 2), (1, 2), (1, 2);

EXPLAIN CBO
SELECT sub1.r FROM
(
        SELECT
            RANK() OVER (ORDER BY t1.b desc) as r
        FROM table1 t1
        JOIN table1 t2 ON t1.a = t2.b
) sub1
LEFT OUTER JOIN table1 t3
ON sub1.r = t3.a;
{code}
- Can we create a Calcite issue and contribute the fix? iiuc, this issue can 
lead to incorrect rewriting, and thus, results. Further, please create a Hive 
issue / leave a note to remove the logic in Hive's {{JoinProjectTransposeRule}} 
once we upgrade?

> JoinProjectTranspose rule should skip Projects containing windowing expression
> ------------------------------------------------------------------------------
>
>                 Key: HIVE-22824
>                 URL: https://issues.apache.org/jira/browse/HIVE-22824
>             Project: Hive
>          Issue Type: Bug
>          Components: Query Planning
>    Affects Versions: 4.0.0
>            Reporter: Vineet Garg
>            Assignee: Vineet Garg
>            Priority: Major
>              Labels: pull-request-available
>         Attachments: HIVE-22824.1.patch, HIVE-22824.2.patch, 
> HIVE-22824.3.patch, HIVE-22824.4.patch, HIVE-22824.5.patch
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> Otherwise this rule could end up creating plan with windowing expression 
> within join condition which hive doesn't know how to process.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to