Uh oh!
There was an error while loading. Please reload this page.
[SPARK-21649][SQL] Support writing data into hive bucket table. - #18866
[SPARK-21649][SQL] Support writing data into hive bucket table.#18866jinxing64 wants to merge 2 commits into
Conversation
jinxing64
commented
Aug 7, 2017
I added the unit test referring (https://github.com/apache/hive/blob/branch-1/ql/src/java/org/apache/hadoop/hive/ql/optimizer/AbstractBucketJoinProc.java#L393). |
There was a problem hiding this comment.
I saw that HiveHash simulates Hive's hashing function from Hive v1.2.1.... Is there any compatibility issue for Hive before 1.2.1?
There was a problem hiding this comment.
@viirya Thanks a lot for comment !
I compared code between v0.13(https://github.com/apache/hive/blob/branch-0.13/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java#L496) and v1.2.1(https://github.com/apache/hive/blob/branch-1/serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorUtils.java#L557). In my understanding, there's no compatibility issue. v1.2.1 add hashcode support for more types(INTERVAL_YEAR_MONTH, INTERVAL_DAY_TIME), for the existing types, they are compatible with each other.
There was a problem hiding this comment.
Ok. Let's add a comment for the parameter useHiveHash.
SparkQA
commented
Aug 7, 2017
Test build #80322 has finished for PR 18866 at commit
|
jinxing64
commented
Aug 7, 2017
Jenkins, retest this please. |
There was a problem hiding this comment.
It is hard to know the meaning of this Option parameter. Let's add a @param for it?
There was a problem hiding this comment.
This looks obscure. I need to verify it by calculating HiveHash values for 0 until 100. Maybe we should compute the actual hive hash value here, instead of bucket to (100, 4).
There was a problem hiding this comment.
Yes, that would be better. I've updated, please take another look : )
SparkQA
commented
Aug 7, 2017
Test build #80341 has finished for PR 18866 at commit
|
jinxing64
commented
Aug 7, 2017
@viirya |
SparkQA
commented
Aug 7, 2017
Test build #80348 has finished for PR 18866 at commit
|
SparkQA
commented
Aug 7, 2017
Test build #80349 has finished for PR 18866 at commit
|
jinxing64
commented
Aug 8, 2017
cc @cloud-fan |
cloud-fan
commented
Aug 9, 2017
Hash function is not the only issue, one important difference is: hive will shuffle before write, and make sure one bucket has only one file. Spark doesn't shuffle and each write task may write a file for a bucket. More details please refer to https://docs.google.com/document/d/1a8IDh23RAkrkg9YYAeO51F4aGO8-xAlupKwdshve2fc/edit#heading=h.ualze2k709kj also cc @tejasapatil |
SparkQA
commented
Aug 13, 2017
Test build #80597 has finished for PR 18866 at commit
|
SparkQA
commented
Aug 14, 2017
Test build #80637 has finished for PR 18866 at commit
|
SparkQA
commented
Aug 17, 2017
Test build #80782 has finished for PR 18866 at commit
|
SparkQA
commented
Aug 18, 2017
Test build #80837 has finished for PR 18866 at commit
|
SparkQA
commented
Aug 19, 2017
Test build #80873 has finished for PR 18866 at commit
|
In current change:
|
@cloud-fan@gatorsmile@jiangxb1987 |
does this work with append? Even you shuffle the data before writing, we still may have multiple files for one bucket. Is it possible to generalize this patch to data source level? The current approach looks very hacky and is way away from our expection that hive is also a data source. |
jinxing64
commented
Aug 23, 2017
@cloud-fan |
What changes were proposed in this pull request?
Support writing hive bucket table. Spark internally uses Murmur3Hash for partitioning. We can use hive hash for compatibility when write to bucket table.
How was this patch tested?
Unit test.