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

Fang-Yu Rao commented on IMPALA-13982:
--------------------------------------

{quote}The ideas is to add a TableVisitor to traverse the AST right before we 
analyze the AST using Calcite's own SqlValidator in 
[https://github.com/apache/impala/blob/master/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteAnalysisDriver.java]
 and replace nodes representing views with the underlying definitions of views.
{quote}
Looks like it's more than simply replacing a SqlNode representing a regular 
view with another SqlNode representing the underlying definition of the view. 
Refer to [https://gerrit.cloudera.org/c/22883/] for more details.

> Support views for the Calcite planner in Impala
> -----------------------------------------------
>
>                 Key: IMPALA-13982
>                 URL: https://issues.apache.org/jira/browse/IMPALA-13982
>             Project: IMPALA
>          Issue Type: Sub-task
>            Reporter: Fang-Yu Rao
>            Assignee: Fang-Yu Rao
>            Priority: Major
>
> We should be able to support views for the Calcite planner in Impala without 
> a lot of code changes to the current implementation.
> The ideas is to add a {{TableVisitor}} to traverse the AST right before we 
> analyze the AST using Calcite's own {{SqlValidator}} in 
> [https://github.com/apache/impala/blob/master/java/calcite-planner/src/main/java/org/apache/impala/calcite/service/CalciteAnalysisDriver.java]
>  and replace nodes representing views with the underlying definitions of 
> views.
> We also have to take authorization into consideration. Recall that for a view 
> created by a non-superuser, Impala further requires the requesting user to 
> have the privileges on the underlying tables referenced by the view. Refer to 
> [IMPALA-10122 (Part 2): Allow accessing views created by 
> non-superusers|https://github.com/apache/impala/commit/607dc1f170fb8cc013d8ec33fccee59ac4352fe4]
>  for more details. This implies that given an AST after the node replacement 
> mentioned above, we need to distinguish a {{SqlSelect}} node derived from a 
> view from a {{SqlSelect}} that was not derived from a view.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to