aboutsummaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorgatorsmile <gatorsmile@gmail.com>2016-03-21 18:08:41 +0800
committerWenchen Fan <wenchen@databricks.com>2016-03-21 18:08:41 +0800
commit2c5b18fb0fdeabd378dd97e91f72d1eac4e21cc7 (patch)
treea0af9270c27ac3ec3762ba6e2d0c29a21d8969da /CONTRIBUTING.md
parentc35c60fa916e92916442a98f4af123704bb9692e (diff)
downloadspark-2c5b18fb0fdeabd378dd97e91f72d1eac4e21cc7.tar.gz
spark-2c5b18fb0fdeabd378dd97e91f72d1eac4e21cc7.tar.bz2
spark-2c5b18fb0fdeabd378dd97e91f72d1eac4e21cc7.zip
[SPARK-12789][SQL] Support Order By Ordinal in SQL
#### What changes were proposed in this pull request? This PR is to support order by position in SQL, e.g. ```SQL select c1, c2, c3 from tbl order by 1 desc, 3 ``` should be equivalent to ```SQL select c1, c2, c3 from tbl order by c1 desc, c3 asc ``` This is controlled by config option `spark.sql.orderByOrdinal`. - When true, the ordinal numbers are treated as the position in the select list. - When false, the ordinal number in order/sort By clause are ignored. - Only convert integer literals (not foldable expressions). If found foldable expressions, ignore them - This also works with select *. **Question**: Do we still need sort by columns that contain zero reference? In this case, it will have no impact on the sorting results. IMO, we should not allow users do it. rxin cloud-fan marmbrus yhuai hvanhovell -- Update: In these cases, they are ignored in this case. **Note**: This PR is taken from https://github.com/apache/spark/pull/10731. When merging this PR, please give the credit to zhichao-li Also cc all the people who are involved in the previous discussion: adrian-wang chenghao-intel tejasapatil #### How was this patch tested? Added a few test cases for both positive and negative test cases. Author: gatorsmile <gatorsmile@gmail.com> Closes #11815 from gatorsmile/orderByPosition.
Diffstat (limited to 'CONTRIBUTING.md')
0 files changed, 0 insertions, 0 deletions