Bharath Vissapragada 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 8: (3 comments) http://gerrit.cloudera.org:8080/#/c/10908/7/fe/src/main/java/org/apache/impala/analysis/QueryStmt.java File fe/src/main/java/org/apache/impala/analysis/QueryStmt.java: http://gerrit.cloudera.org:8080/#/c/10908/7/fe/src/main/java/org/apache/impala/analysis/QueryStmt.java@138 PS7, Line 138: FeView > I had no semantic reason, I was only trying to follow the convention of col As discussed offline, using InlineViewRef makes it more consistent with collectTableRefs() http://gerrit.cloudera.org:8080/#/c/10908/8/fe/src/main/java/org/apache/impala/analysis/QueryStmt.java File fe/src/main/java/org/apache/impala/analysis/QueryStmt.java: http://gerrit.cloudera.org:8080/#/c/10908/8/fe/src/main/java/org/apache/impala/analysis/QueryStmt.java@138 PS8, Line 138: public abstract void collectInlineViewRefs(Set<FeView> inlineViewRefs); Shouldn't we also collect view refs from withClause_? I see you added a test for it but something like the following would fail. Basically with clause's subqueries not referenced in from clause of the select stmt. (I couldn't think of a better example :D). alter view v2 as with temp(col_a) as (select * from v2) select * from t2; The reason the test case you added works is because the view referenced is also indirectly referenced in the fromClause_ of the SelectStmt. http://gerrit.cloudera.org:8080/#/c/10908/7/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java File fe/src/main/java/org/apache/impala/analysis/SelectStmt.java: http://gerrit.cloudera.org:8080/#/c/10908/7/fe/src/main/java/org/apache/impala/analysis/SelectStmt.java@148 PS7, Line 148: getWhereQueryStm > I have changed it to private. I initially named it getWhereSubQueryStmt but I think is is ok since it conveys the intention better than getWhereQueryStmt(). -- 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: 8 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: Mon, 23 Jul 2018 23:57:49 +0000 Gerrit-HasComments: Yes