Uh oh!
There was an error while loading. Please reload this page.
[SPARK-16515][SQL]set default record reader and writer for script transformation - #14169
[SPARK-16515][SQL]set default record reader and writer for script transformation#14169adrian-wang wants to merge 4 commits into
Conversation
SparkQA
commented
Jul 13, 2016
Test build #62203 has finished for PR 14169 at commit
|
SparkQA
commented
Jul 13, 2016
Test build #62205 has finished for PR 14169 at commit
|
adrian-wang
commented
Jul 13, 2016
This is strange because I can pass the specific test on my local. |
adrian-wang
commented
Jul 13, 2016
I have updated my code and switch to use bash as test case. Hope it will work for Jenkins. |
SparkQA
commented
Jul 13, 2016
Test build #62237 has finished for PR 14169 at commit
|
jameszhouyi
commented
Jul 14, 2016
Hi, Best Regards |
chenghao-intel
commented
Jul 14, 2016
LGTM. cc @yhuai@liancheng |
jameszhouyi
commented
Jul 15, 2016
Hi Spark guys, Best Regards, |
rxin
commented
Jul 15, 2016
What do you mean that "Since Spark 2.0 has deleted those config keys from hive conf" ? |
adrian-wang
commented
Jul 15, 2016
@rxin In Spark 2.0, those conf values start with "hive.", which have default value in HiveConf, cannot get the default value now. |
chenghao-intel
commented
Jul 15, 2016
HiveConf provides default value |
rxin
commented
Jul 15, 2016
Are all script transforms broken? Don't we already have a test case that actually run script transforms? |
adrian-wang
commented
Jul 15, 2016
@rxin Only those script transformation cases which use LazySimpleSerde would be affected. |
| // SPARK-10310: Special cases LazySimpleSerDe | ||
| val recordHandler = if (name == "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe") { | ||
| Try(conf.getConfString(configKey)).toOption |
There was a problem hiding this comment.
Should we just use getConfString(key: String, defaultValue: String)? That defaultRecordHandler method seems unnecessary.
There was a problem hiding this comment.
The default value is different for different key, you mean to inline the defaultRecordHandler function?
rxin
commented
Jul 16, 2016
@jameszhouyi / adrian-wang / @chenghao-intel related to this pull request, we want to have a native implementation for ScriptTransform that does not depend on Hive's serdes. Can you let me know what features are missing from the current native implementation that is not lazysimpleserde? What does lazysimpleserde actually support that the built-in implementation does not? |
| } | ||
| val (inFormat, inSerdeClass, inSerdeProps, reader) = | ||
| format(inRowFormat, "hive.script.recordreader") |
There was a problem hiding this comment.
Can we pass in the default value for the reader/writer? like format(inRowFormat, "hive.script.recordreader", "org.apache.hadoop.hive.ql.exec.TextRecordReader") and format(outRowFormat, "hive.script.recordwriter", "org.apache.hadoop.hive.ql.exec.TextRecordWriter"). Then, in def format, we just use getConfString(key: String, defaultValue: String)
SparkQA
commented
Jul 18, 2016
Test build #62451 has finished for PR 14169 at commit
|
| // Decode and input/output format. | ||
| type Format = (Seq[(String, String)], Option[String], Seq[(String, String)], Option[String]) | ||
| def format(fmt: RowFormatContext, configKey: String): Format = fmt match { | ||
| def format(fmt: RowFormatContext, configKey: String, configValue: String): Format = fmt match { |
There was a problem hiding this comment.
The name should show that this value is default value, right?
…ansformation ## What changes were proposed in this pull request? In ScriptInputOutputSchema, we read default RecordReader and RecordWriter from conf. Since Spark 2.0 has deleted those config keys from hive conf, we have to set default reader/writer class name by ourselves. Otherwise we will get None for LazySimpleSerde, the data written would not be able to read by script. The test case added worked fine with previous version of Spark, but would fail now. ## How was this patch tested? added a test case in SQLQuerySuite. Closes#14169 Author: Daoyuan Wang <daoyuan.wang@intel.com> Author: Yin Huai <yhuai@databricks.com> Closes#14249 from yhuai/scriptTransformation. (cherry picked from commit 96e9afa) Signed-off-by: Yin Huai <yhuai@databricks.com>
What changes were proposed in this pull request?
In
ScriptInputOutputSchema, we read defaultRecordReaderandRecordWriterfrom conf. Since Spark 2.0 has deleted those config keys from hive conf, we have to set default reader/writer class name by ourselves. Otherwise we will getNoneforLazySimpleSerde, the data written would not be able to read by script. The test case added worked fine with previous version of Spark, but would fail now.How was this patch tested?
added a test case in SQLQuerySuite.