godfreyhe commented on a change in pull request #14502: URL: https://github.com/apache/flink/pull/14502#discussion_r552616673
########## File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/utils/SortSpec.java ########## @@ -39,38 +39,45 @@ public SortSpec(SortFieldSpec[] fieldSpecs) { this.fieldSpecs = fieldSpecs; } - public SortSpec getSubSpec(int startIndex) { + /** Creates a sub SortSpec starting from startIndex sort field. */ + public SortSpec createSubSortSpec(int startIndex) { Review comment: please check whether the `startIndex` is valid. ########## File path: flink-table/flink-table-planner-blink/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/utils/SortSpec.java ########## @@ -39,38 +39,45 @@ public SortSpec(SortFieldSpec[] fieldSpecs) { this.fieldSpecs = fieldSpecs; } - public SortSpec getSubSpec(int startIndex) { + /** Creates a sub SortSpec starting from startIndex sort field. */ + public SortSpec createSubSortSpec(int startIndex) { return new SortSpec( Arrays.stream(fieldSpecs, startIndex, fieldSpecs.length) .toArray(SortFieldSpec[]::new)); } + /** Gets field index of all fields in input. */ public int[] getFieldIndices() { return Arrays.stream(fieldSpecs).mapToInt(SortFieldSpec::getFieldIndex).toArray(); } - public boolean[] getFieldOrders() { + /** Gets flags of all fields for whether to sort in ascending order or not. */ + public boolean[] getFieldAscendingOrders() { Review comment: nit: simplified as `getAscendingOrders` ? ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org