[
https://issues.apache.org/jira/browse/IMPALA-7209?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16563200#comment-16563200
]
ASF subversion and git services commented on IMPALA-7209:
---------------------------------------------------------
Commit 9146f73a58c645cd861006cd6c90d9cbf08feeec in impala's branch
refs/heads/master from poojanilangekar
[ https://git-wip-us.apache.org/repos/asf?p=impala.git;h=9146f73 ]
IMPALA-7209: Disallow self referencing in ALTER VIEW statements
Previously, ALTER VIEW queries did not carry out reference checks
in the analysis phase. This allowed the DDL operation to succeed
but subsequent queries to the view threw StackOverflowError
because the catalog was unable to resolve the reference. With this
change, the AlterViewStmt checks for direct and in-direct self
references before altering a view.
Testing: Added tests to AnalyzeDDLTest to verify it.
Change-Id: I17c231c9d74d9d411463a408b086eb874090b9b7
Reviewed-on: http://gerrit.cloudera.org:8080/10908
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
> Disallow self referencing ALTER VIEW statments
> ----------------------------------------------
>
> Key: IMPALA-7209
> URL: https://issues.apache.org/jira/browse/IMPALA-7209
> Project: IMPALA
> Issue Type: Bug
> Components: Frontend
> Reporter: Pooja Nilangekar
> Assignee: Pooja Nilangekar
> Priority: Major
>
> Currently, an ALTER VIEW statement accepts self referencing definitions.
> However, upon querying the altered view, the analyzer is unable to find the
> reference and hence throws a StackOverflowError: null error.
> The expected behavior would be to throw an AnalysisException while executing
> the alter view statement.
>
> Example:
>
> {code:java}
> [localhost:21000] default> create view foo as select * from
> functional.alltypes;
> Query: create view foo as select * from functional.alltypes
> Query submitted at: 2018-07-03 11:36:48 (Coordinator:
> http://pooja-OptiPlex-7040:25000)
> Query progress can be monitored at:
> http://pooja-OptiPlex-7040:25000/query_plan?query_id=614e03efbcb4d8b1:586a4bad00000000
> +------------------------+
> | summary |
> +------------------------+
> | View has been created. |
> +------------------------+
> Fetched 1 row(s) in 0.26s
> [localhost:21000] default> alter view foo as select * from foo;
> Query: alter view foo as select * from foo
> +------------------------+
> | summary |
> +------------------------+
> | View has been altered. |
> +------------------------+
> Fetched 1 row(s) in 5.65s
> [localhost:21000] default> select * from foo;
> Query: select * from foo
> Query submitted at: 2018-07-03 11:37:12 (Coordinator:
> http://pooja-OptiPlex-7040:25000)
> ERROR: StackOverflowError: null
> {code}
>
> The select statement on the view fails because the analyzer can't resolve its
> reference. Other databases return failure during the alter view statement
> because stating.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]