Daniel Becker has posted comments on this change. ( http://gerrit.cloudera.org:8080/20405 )
Change subject: IMPALA-12406: OPTIMIZE statement as an alias for INSERT OVERWRITE ...................................................................... Patch Set 2: (11 comments) http://gerrit.cloudera.org:8080/#/c/20405/2//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/20405/2//COMMIT_MSG@14 PS2, Line 14: Currently INSERT OVERWRITE is used as a workaround to rewrite and You could describe what the insert overwrite statemtnt is, i.e. that it overwrites the table with itself. http://gerrit.cloudera.org:8080/#/c/20405/2//COMMIT_MSG@17 PS2, Line 17: OPTIMIZE Nit: "the OPTIMIZE statement"? http://gerrit.cloudera.org:8080/#/c/20405/2//COMMIT_MSG@19 PS2, Line 19: This patch introduces the new syntax as an alias for INSERT OVERWRITE. Will OPTIMIZE always be an alias for INSERT OVERWRITE or is it planned to be changed later? http://gerrit.cloudera.org:8080/#/c/20405/2//COMMIT_MSG@23 PS2, Line 23: t Nit: extra t. http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java File fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java: http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@33 PS2, Line 33: */ It would be good to describe what kind of insert overwrite statement exactly it will be, e.g. OPTIMIZE TABLE tbl; -->> INSERT OVERWRITE TABLE tbl (SELECT * FROM tbl) http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@34 PS2, Line 34: { Nit: add space before {. http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@45 PS2, Line 45: targetTable Wouldn't 'targetTableName' be better? http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@48 PS2, Line 48: selectListItems.add(SelectListItem.createStarItem(null)); We'll have to be careful with complex types. Normally they are not included in "select *" queries but if EXPAND_COMPLEX_TYPES is set then they are, see https://gerrit.cloudera.org/#/c/18863. We will fail in either case: if they are not included then the number of columns won't match, if they are included we get an error because we can't write complex types. http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@81 PS2, Line 81: public void reset() { 'targetTableName_' is possibly modified during analyze(). Shouldn't it also be reset to its original value (the one set in the constructor)? http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@90 PS2, Line 90: @Override Nit: add an empty line before this one. http://gerrit.cloudera.org:8080/#/c/20405/2/fe/src/main/java/org/apache/impala/analysis/OptimizeStmt.java@94 PS2, Line 94: @Override Nit: add an empty line before this one. -- To view, visit http://gerrit.cloudera.org:8080/20405 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ief42537499ffe64fafdefe25c8d175539234c4e7 Gerrit-Change-Number: 20405 Gerrit-PatchSet: 2 Gerrit-Owner: Noemi Pap-Takacs <npaptak...@cloudera.com> Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com> Gerrit-Reviewer: Gabor Kaszab <gaborkas...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Noemi Pap-Takacs <npaptak...@cloudera.com> Gerrit-Reviewer: Tamas Mate <tma...@apache.org> Gerrit-Reviewer: Zoltan Borok-Nagy <borokna...@cloudera.com> Gerrit-Comment-Date: Tue, 29 Aug 2023 12:02:34 +0000 Gerrit-HasComments: Yes