[ https://issues.apache.org/jira/browse/BEAM-5074?focusedWorklogId=132043&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-132043 ]
ASF GitHub Bot logged work on BEAM-5074: ---------------------------------------- Author: ASF GitHub Bot Created on: 07/Aug/18 20:02 Start Date: 07/Aug/18 20:02 Worklog Time Spent: 10m Work Description: apilloud commented on a change in pull request #6145: [BEAM-5074][SQL] improve BeamSqlRowComparator URL: https://github.com/apache/beam/pull/6145#discussion_r208366111 ########## File path: sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/impl/rel/BeamSortRel.java ########## @@ -317,12 +317,31 @@ public int compare(Row row1, Row row2) { } } - fieldRet *= (orientation.get(i) ? -1 : 1); + fieldRet *= (orientation.get(i) ? 1 : -1); + if (fieldRet != 0) { return fieldRet; } } return 0; } } + + private static class ReversedBeamSqlRowComparator implements Comparator<Row>, Serializable { + private BeamSqlRowComparator comparator; Review comment: nit: you should make this `final`. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on 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 Issue Time Tracking ------------------- Worklog Id: (was: 132043) Time Spent: 1.5h (was: 1h 20m) > Make BeamSqlRowComparator more general > -------------------------------------- > > Key: BEAM-5074 > URL: https://issues.apache.org/jira/browse/BEAM-5074 > Project: Beam > Issue Type: Improvement > Components: dsl-sql > Reporter: Rui Wang > Assignee: Rui Wang > Priority: Major > Fix For: Not applicable > > Time Spent: 1.5h > Remaining Estimate: 0h > > BeamSqlRowComparator returns reversed comparison results (if a < b in terms > of value, BeamSqlRowComparator returns a > b). > > Make it return forward results and have a reversed comparator to do the > current thing. > -- This message was sent by Atlassian JIRA (v7.6.3#76005)