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

(1 comment)

I am sorry I had to rebase this change. I couldn't get impalad to start due to 
IMPALA-7316.

http://gerrit.cloudera.org:8080/#/c/10908/6/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/6/fe/src/main/java/org/apache/impala/analysis/AlterViewStmt.java@69
PS6, Line 69: if (inlineViewRefs.contains(((InlineViewRef) tblRef).getView())) {
            :       throw new AnalysisException(
            :           String.format("Self-reference not allowed on view: %s", 
tblRef.toSql()));
            :     }
            :
            :     createColumnAndViewDefs(analyzer);
            :     if (BackendConfig.INSTANCE.getComputeLineage() || 
RuntimeEnv.INSTANCE.isTestEnv()) {
            :       computeLineageGraph(analyzer);
            :     }
            :   }
            :
            :   @Override
            :   public String toSql() {
            :     StringBuilder sb = new StringBuilder();
            :     sb.append("ALTER VIEW ");
            :     if (tableName_.getDb() != null) {
            :       sb.append(tableName_.getDb() + ".");
            :     }
            :     sb.append(tableName_.getTbl());
            :     if (columnDefs_ != null) sb.append("(" + getColumnNames() + 
")");
            :     sb.append(" AS " + viewDefStmt_.toSql());
            :     return sb.toString();
            :   }
            : }
            :
            :
            :
            :
            :
> How about factoring this out into a method in QueryStmt and have helper met
Done



--
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: 7
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: Sat, 21 Jul 2018 01:30:37 +0000
Gerrit-HasComments: Yes

Reply via email to