Fang-Yu Rao created IMPALA-15500:
------------------------------------

             Summary: Privilege requests for columns in the USING clause are 
not registered by ImpalaSqlValidatorImpl of the Calcite planner
                 Key: IMPALA-15500
                 URL: https://issues.apache.org/jira/browse/IMPALA-15500
             Project: IMPALA
          Issue Type: Bug
            Reporter: Fang-Yu Rao
            Assignee: Fang-Yu Rao


Privilege requests for columns in the USING clause are not registered by 
[ImpalaSqlValidatorImpl.java|https://github.com/apache/impala/blob/master/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/ImpalaSqlValidatorImpl.java].

For instance, in the following query, Impala's Calcite planner does not 
register the privilege request for the column '{{{}id{}}}' of the table 
'{{{}functional.alltypestiny{}}}'.
{code:java}
with alltypes as (select 100 as id)
select alltypes.id from alltypes join functional.alltypestiny using (id)
{code}
We most likely need to override 
[SqlValidatorImpl#validateJoin()|https://github.com/apache/calcite/blob/e9185e9/core/src/main/java/org/apache/calcite/sql/validate/SqlValidatorImpl.java#L4228-L4367],
 which is a protected method. Note that the column name resolution happens 
within {{validateCommonJoinColumn(id, left, right, scope, natural)}} but 
unfortunately it's a private method.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to