impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dimitris Tsirogiannis (Code Review)" <>
Subject [Impala-ASF-CR] IMPALA-4166: Add SORT BY sql clause
Date Wed, 05 Apr 2017 05:13:43 GMT
Dimitris Tsirogiannis has posted comments on this change.

Change subject: IMPALA-4166: Add SORT BY sql clause

Patch Set 7:

File fe/src/main/cup/sql-parser.cup:

PS7, Line 984: Set
There is no KW_SET, right? Update the name?
File fe/src/main/java/org/apache/impala/analysis/

PS7, Line 73: getTargetTable()
File fe/src/main/java/org/apache/impala/analysis/

Line 2484:    * Add a warning that will be displayed to the user. Ignores null messages.
Comment that no warning can be issued if warnings have been retrieved?
File fe/src/main/java/org/apache/impala/analysis/

PS7, Line 119: sortByColumns_.
I think this can throw a NPE. Looking at the parser I see that CreateTableListStmt can pass
null for sortByColumns_ and couldn't find where this changes.
File fe/src/main/java/org/apache/impala/analysis/

PS7, Line 296: propertyString
File fe/src/main/java/org/apache/impala/analysis/

PS7, Line 41: /**
            :    * Analyzes the '' property of 'table'.
            :    */
            :   public static List<Integer> analyzeSortByColumns(Table table) throws
AnalysisException {
            :     return TablePropertyAnalyzer.analyzeSortByColumns(
            :         table.getMetaStoreTable().getParameters(), table);
            :   }
            :   /**
            :    * Analyzes the '' property in 'tblProperties' against the
columns of
            :    * 'table'.
            :    */
            :   public static List<Integer> analyzeSortByColumns(Map<String, String>
            :       Table table) throws AnalysisException {
            :     return TablePropertyAnalyzer.analyzeSortByColumns(
            :         getSortByColumnsFromProperties(tblProperties), table);
            :   }
These are used in only one place, right? Maybe inline there?

Line 76:     }
Precondition check for HBase?

PS7, Line 127: private static List<String> getSortByColumnsFromProperties(
             :       Map<String, String> tblProperties) {
You may want to consider if it's better to have a getSortByColumn(Table table) function instead
of this one. Just a though...
File fe/src/main/java/org/apache/impala/planner/

PS7, Line 539: // If the table has a '' property and the query has a 'noclustered'
             :     // hint, we issue a warning during analysis and ignore the 'noclustered'
That comment doesn't seem relevant here. Remove?

PS7, Line 541: !insertStmt.hasNoClusteredHint()
If insertStmt.hasClusteredHint() is true doesn't that imply that hasNoClusteredHint() is false?
I thought they are mutually exclusive.
File fe/src/main/java/org/apache/impala/service/

PS7, Line 1793: params.sort_by_columns.size() > 0
use isEmpty()
File fe/src/test/java/org/apache/impala/analysis/

Line 526: 
Test for HBase and Kudu?

Line 1054:   }
Same here (HBase + Kudu). You need to put all Kudu tests in a function and check for supported.

PS7, Line 1904: most
"must" typo

PS7, Line 1920: // Kudu table tests are in TestCreateManagedKuduTable().
No need for that comment :)
File fe/src/test/java/org/apache/impala/analysis/

PS7, Line 2347: // Sort by clause
How about some tests with additional table options? Try changing the order in which the table
options are specified, e.g. location bla sort by ()
File testdata/workloads/functional-planner/queries/PlannerTest/ddl.test:

PS7, Line 207: table
select query
File testdata/workloads/functional-planner/queries/PlannerTest/insert-sort-by.test:

PS7, Line 194: sort by columns with a join
can you also add an order by clause?

To view, visit
To unsubscribe, visit

Gerrit-MessageType: comment
Gerrit-Change-Id: I08834f38a941786ab45a4381c2732d929a934f75
Gerrit-PatchSet: 7
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Lars Volker <>
Gerrit-Reviewer: Dimitris Tsirogiannis <>
Gerrit-Reviewer: Lars Volker <>
Gerrit-Reviewer: Marcel Kornacker <>
Gerrit-Reviewer: Thomas Tauber-Marshall <>
Gerrit-HasComments: Yes

View raw message