Bharath Vissapragada has posted comments on this change. ( http://gerrit.cloudera.org:8080/12009 )
Change subject: IMPALA-7905: Hive keywords not quoted for identifiers ...................................................................... Patch Set 5: (6 comments) Few minor comments, lgtm otherwise. http://gerrit.cloudera.org:8080/#/c/12009/1//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/12009/1//COMMIT_MSG@17 PS1, Line 17: insentisitive typo http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java File fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java: http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java@116 PS5, Line 116: an identifier nit: 'ident' http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java@124 PS5, Line 124: ANTLRStringStream(ident.toUpperCase() probably switch to ANTLRNoCaseStringStream to be consistent with Hive? http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java@148 PS5, Line 148: if (SqlScanner.isReserved(ident)) return true; : // Impala's scanner recognizes the ".123" portion of "db.123e45" as a decimal, : // so while the quoting is not necessary for the given identifier itself, the quotes : // are needed if this identifier will be preceded by a ".". : return Character.isDigit(ident.charAt(0)); simplify to return SqlScanner.isReserved(ident) || Character.isDigit(ident.charAt(0)) ;? http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/main/java/org/apache/impala/analysis/ToSqlUtils.java@169 PS5, Line 169: if (ident.equals("*")) return ident; Why this special case? (optimization?) http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java File fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java: http://gerrit.cloudera.org:8080/#/c/12009/5/fe/src/test/java/org/apache/impala/analysis/ToSqlTest.java@186 PS5, Line 186: // Test implicit table aliases with unqualified and fully qualified Can we do col = ToSqlUtils.identSql(col) here instead? (same for table) -- To view, visit http://gerrit.cloudera.org:8080/12009 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I06cc20b052a3a66535a171c36b4b31477c0ba6d0 Gerrit-Change-Number: 12009 Gerrit-PatchSet: 5 Gerrit-Owner: Paul Rogers <[email protected]> Gerrit-Reviewer: Bharath Vissapragada <[email protected]> Gerrit-Reviewer: Fredy Wijaya <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Paul Rogers <[email protected]> Gerrit-Comment-Date: Sat, 22 Dec 2018 01:58:44 +0000 Gerrit-HasComments: Yes
