Mihaly Szjatinya has posted comments on this change. ( http://gerrit.cloudera.org:8080/21825 )
Change subject: IMPALA-889: Add trim() function matching ANSI SQL definition ...................................................................... Patch Set 13: (5 comments) http://gerrit.cloudera.org:8080/#/c/21825/12//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/21825/12//COMMIT_MSG@56 PS12, Line 56: 3. No TRIM keyword. Following EXTRACT-FROM, no "TRIM" keyword was > nit: wrap at 72 chars Done http://gerrit.cloudera.org:8080/#/c/21825/12/fe/src/main/cup/sql-parser.cup File fe/src/main/cup/sql-parser.cup: http://gerrit.cloudera.org:8080/#/c/21825/12/fe/src/main/cup/sql-parser.cup@3864 PS12, Line 3864: > nit: extra space Done http://gerrit.cloudera.org:8080/#/c/21825/12/fe/src/main/cup/sql-parser.cup@3871 PS12, Line 3871: // For special case: "select trim(table_column from 'string') from table" > other forms are handled by another clause Imho "special case" implies exactly that, but feel free to edit comments if you insist. http://gerrit.cloudera.org:8080/#/c/21825/10/fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java File fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java: http://gerrit.cloudera.org:8080/#/c/21825/10/fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java@159 PS10, Line 159: rMsg.append("Expression '" + charset_.toSql() + "' ha > The type checking looks good now, but it still doesn't seem ok that super.a As explained previously reverse order is a trick for better AnalysisError. http://gerrit.cloudera.org:8080/#/c/21825/12/fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java File fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java: http://gerrit.cloudera.org:8080/#/c/21825/12/fe/src/main/java/org/apache/impala/analysis/TrimFromExpr.java@148 PS12, Line 148: super.getParams().size() == 1 > Shouldn't this be always the same in the slotRef_ != null branch? It's rather a sanity check, to emphasize that slot is added as exactly second parameter for btrim(). -- To view, visit http://gerrit.cloudera.org:8080/21825 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I3c4fa6d0d8d0684c4b6d8dac8fd531d205e4f7b4 Gerrit-Change-Number: 21825 Gerrit-PatchSet: 13 Gerrit-Owner: Mihaly Szjatinya <[email protected]> Gerrit-Reviewer: Csaba Ringhofer <[email protected]> Gerrit-Reviewer: Daniel Becker <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Mihaly Szjatinya <[email protected]> Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]> Gerrit-Comment-Date: Tue, 29 Oct 2024 14:03:13 +0000 Gerrit-HasComments: Yes
