Pooja Nilangekar has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/10908 )

Change subject: IMPALA-7209: Disallow self referencing in ALTER VIEW statements
......................................................................


Patch Set 6:

(2 comments)

http://gerrit.cloudera.org:8080/#/c/10908/4/fe/src/main/java/org/apache/impala/analysis/AlterViewStmt.java
File fe/src/main/java/org/apache/impala/analysis/AlterViewStmt.java:

http://gerrit.cloudera.org:8080/#/c/10908/4/fe/src/main/java/org/apache/impala/analysis/AlterViewStmt.java@72
PS4, Line 72: ((SelectStmt) stmt).getTableRefs();
> This only gets you fromClause_'s TableRefs. For example something like
Done.
I have added test cases for where clause and with clause. Other classes like 
"GROUP BY", "ORDER BY" and "HAVING" don't support sub-queries.


http://gerrit.cloudera.org:8080/#/c/10908/4/fe/src/main/java/org/apache/impala/analysis/AlterViewStmt.java@75
PS4, Line 75:             InlineViewRef fromViewRef = (InlineViewRef) 
fromTblRef;
> While I see the intention here, a cleaner way for this is to do something l
That was my initial approach. However, I faced the issue that while getting the 
TableRefs from the viewDefStmt_, the function resolves it to the underlying 
table definition. Since at this point, the view definition is still not 
altered. Yet, the SQL statement contains references to the view itself. So this 
approach ensures that we get all the view references that need to be resolved 
instead of getting just the eventual base table references.



--
To view, visit http://gerrit.cloudera.org:8080/10908
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I17c231c9d74d9d411463a408b086eb874090b9b7
Gerrit-Change-Number: 10908
Gerrit-PatchSet: 6
Gerrit-Owner: Pooja Nilangekar <pooja.nilange...@cloudera.com>
Gerrit-Reviewer: Bharath Vissapragada <bhara...@cloudera.com>
Gerrit-Reviewer: Bikramjeet Vig <bikramjeet....@cloudera.com>
Gerrit-Reviewer: Fredy Wijaya <fwij...@cloudera.com>
Gerrit-Reviewer: Pooja Nilangekar <pooja.nilange...@cloudera.com>
Gerrit-Comment-Date: Tue, 17 Jul 2018 20:56:08 +0000
Gerrit-HasComments: Yes

Reply via email to