GitHub user chenghao-intel opened a pull request:

    https://github.com/apache/spark/pull/3496

    [SPARK-4636] [SQL] WIP: Cluster By & Distribute By doesn't follow the 
result of Hive

    This is a very interesting bug.
    Semantically, Cluster By & Distribute By will not cause a global ordering, 
as described in Hive wiki:
    https://cwiki.apache.org/confluence/display/Hive/LanguageManual+SortBy
    
    However, the partition keys are sorted in MapReduce after shuffle, so from 
the user point of view, the partition key itself is global ordered, and it may 
looks like:
    
http://stackoverflow.com/questions/13715044/hive-cluster-by-vs-order-by-vs-sort-by
    
    So I change the `HashPartitioning` to `RangePartitioning` for the 
`Repartition` operator. 
    
    And 2 issues still need to be figured out:
    [ ] Rename the `Repartition` to `SortPartition`, this probably depends on 
#3386 #3481 
    [ ] Optimization for clauses like `DISTRIBUTE BY key SORT BY key`, we can 
ignore the `SORT BY` in this case.
    [ ] `ORDER BY` can be optimized without shuffling all of the data to a 
single node.
    


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/chenghao-intel/spark repartition

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/spark/pull/3496.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #3496
    
----
commit 333f881aa3450bbc3dd09abf6bd0cbfba15b5c5e
Author: Cheng Hao <[email protected]>
Date:   2014-11-27T07:21:41Z

    Change the HashPartitioning to RangePartitioning according to the semantic 
of distrubte by and cluster by

commit e57e71555c387ea9fd8793b33bf28bd8e219ab3f
Author: Cheng Hao <[email protected]>
Date:   2014-11-27T07:24:26Z

    Add to whiltelist

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to