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

Maryann Xue commented on PHOENIX-1610:
--------------------------------------

bq. Can you get rid of the instanceof check if you do that logic based on the 
number of expressions in the ON clause?
No. IN subqueries can specify RVCs explicitly. e.g. SELECT * FROM t WHERE (a,b) 
in (SELECT a, b FROM t WHERE c = '0');

RHS key expression is evaluated against each row from the RHS table or from the 
inner query to a constant wrapped in a LiteralExpression. An InListExpression 
is constructed with the LHS key expression and a list of those 
LiteralExpressions. But RVC as RHS expression should be handled differently by 
not evaluating the RVC expression itself as a whole. Instead, we should 
evaluate its children and wrap them into a new RVC expression, in order to make 
sure that it can later be coerced against LHS expression.


> Incorrect subquery results caused by unpaired contextStack push/pop
> -------------------------------------------------------------------
>
>                 Key: PHOENIX-1610
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-1610
>             Project: Phoenix
>          Issue Type: Bug
>    Affects Versions: 3.0.0, 4.0.0
>            Reporter: Maryann Xue
>            Assignee: Maryann Xue
>             Fix For: 4.3, 3.3
>
>         Attachments: 1610.patch
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to