Skip to content

Conversation

@yhuai
Copy link
Contributor

@yhuai yhuai commented Jul 18, 2016

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

@SparkQA
Copy link

SparkQA commented Jul 18, 2016

Test build #62479 has finished for PR 14249 at commit e999f2c.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

// SPARK-10310: Special cases LazySimpleSerDe
val recordHandler = if (name == "org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe") {
Try(conf.getConfString(configKey)).toOption
Option(conf.getConfString(configKey, defaultConfigValue))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Option is used to turn the returned handler to the type that is expected by ScriptInputOutputSchema.

@yhuai
Copy link
Contributor Author

yhuai commented Jul 18, 2016

I am merging this PR to master and branch 2.0.

Thanks @adrian-wang

asfgit pushed a commit that referenced this pull request Jul 18, 2016
…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 <[email protected]>
Author: Yin Huai <[email protected]>

Closes #14249 from yhuai/scriptTransformation.

(cherry picked from commit 96e9afa)
Signed-off-by: Yin Huai <[email protected]>
@asfgit asfgit closed this in 96e9afa Jul 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants