You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/04 06:55:00 UTC

[jira] [Work logged] (BEAM-5074) Make BeamSqlRowComparator more general

     [ https://issues.apache.org/jira/browse/BEAM-5074?focusedWorklogId=131177&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-131177 ]

ASF GitHub Bot logged work on BEAM-5074:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Aug/18 06:54
            Start Date: 04/Aug/18 06:54
    Worklog Time Spent: 10m 
      Work Description: amaliujia opened a new pull request #6145: [BEAM-5074][SQL] improve BeamSqlRowComparator
URL: https://github.com/apache/beam/pull/6145
 
 
   Refactoring BeamSqlRowComparator a bit to make it can return comparison results in either natural order or reversed order.
   
   In the past, BeamSqlRowComparator only returned comparison results in reversed order. It was because BeamSortRel only supports `ORDER BY LIMIT` by using `Top` (`Top` by default returns elements in descending order). For example, if there is a query `SELECT * FROM table ORDER BY id ASC LIMIT 1`,  and assuming there are two rows in table with id `1` and `2` separately, in order to return the right result by using `Top`,  `BeamSqlRowComparator` have to tell `Top` that the row with id `1` is bigger (which means comparator returns in reversed order).
   
   
   In order to support `ORDER BY ASC` and ORDER BY DESC`, there is a need to have a comparator that returns in natural order (if 1 < 2, then returns -1 to indicate 1 < 2). So in this PR,  BeamSqlRowComparator is changed to achieve this goal. 
   
   ------------------------
   
   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   It will help us expedite review of your Pull Request if you tag someone (e.g. `@username`) to look at it.
   
   Post-Commit Tests Status (on master branch)
   ------------------------------------------------------------------------------------------------
   
   Lang | SDK | Apex | Dataflow | Flink | Gearpump | Samza | Spark
   --- | --- | --- | --- | --- | --- | --- | ---
   Go | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Go_GradleBuild/lastCompletedBuild/) | --- | --- | --- | --- | --- | ---
   Java | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_GradleBuild/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Apex_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Dataflow_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Flink_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Gearpump_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Samza_Gradle/lastCompletedBuild/) | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Java_ValidatesRunner_Spark_Gradle/lastCompletedBuild/)
   Python | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Python_Verify/lastCompletedBuild/) | --- | [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_VR_Dataflow/lastCompletedBuild/) </br> [![Build Status](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/badge/icon)](https://builds.apache.org/job/beam_PostCommit_Py_ValCont/lastCompletedBuild/) | --- | --- | --- | ---
   
   
   
   
   

----------------------------------------------------------------
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:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 131177)
            Time Spent: 10m
    Remaining Estimate: 0h

> 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
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> BeamSqlRowComparator returns reversed comparison results (if a < b in terms of value, BeamSqlRowComparator returns a > b). 
>  
> Add a flag to turn on/off this reversed effect. The reason of doing this is to help implement ORDER BY ASC/DESC in the normal way.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)