Fang-Yu Rao created IMPALA-13982:
------------------------------------

             Summary: 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


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}} not not derived from a view.




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

Reply via email to