Uh oh!
There was an error while loading. Please reload this page.
[SPARK-19137][SQL] Fix withSQLConf to reset OptionalConfigEntry correctly - #16522
[SPARK-19137][SQL] Fix withSQLConf to reset OptionalConfigEntry correctly#16522dongjoon-hyun wants to merge 3 commits into
withSQLConf to reset OptionalConfigEntry correctly#16522Conversation
vanzin
commented
Jan 9, 2017
Looks ok since this is what other tests here do; but I wonder why this case isn't handled in |
zsxwing
commented
Jan 9, 2017
@dongjoon-hyun The expected behavior is this test should use a temp folder instead. Looks like it gets |
dongjoon-hyun
commented
Jan 9, 2017
dongjoon-hyun
commented
Jan 10, 2017
I found the root cause. |
withSQLConf to reset OptionalConfigEntry correctlydongjoon-hyun
commented
Jan 10, 2017
| val currentValues = keys.map(key => Try(spark.conf.get(key)).toOption) | ||
| val currentValues = keys.map { key => | ||
| if (spark.conf.contains(key)) { | ||
| Try(spark.conf.get(key)).toOption |
There was a problem hiding this comment.
Nit: you can just use Some(spark.conf.get(key)). It's better to not hide exceptions from get.
dongjoon-hyun
commented
Jan 10, 2017
Thank you. I updated it. |
SparkQA
commented
Jan 10, 2017
Test build #71099 has finished for PR 16522 at commit
|
SparkQA
commented
Jan 10, 2017
Test build #71106 has finished for PR 16522 at commit
|
SparkQA
commented
Jan 10, 2017
Test build #71107 has finished for PR 16522 at commit
|
dongjoon-hyun
commented
Jan 10, 2017
| protected def withSQLConf(pairs: (String, String)*)(f: => Unit): Unit = { | ||
| val (keys, values) = pairs.unzip | ||
| val currentValues = keys.map(key => Try(spark.conf.get(key)).toOption) | ||
| val currentValues = keys.map { key => |
There was a problem hiding this comment.
I think this can just be keys.flatMap(conf.get). But I'll let Ryan look since he's more involved with this code.
There was a problem hiding this comment.
@vanzinconf.get won't work as it will use defaultValueString when the key doesn't exist.
zsxwing
commented
Jan 10, 2017
LGTM. Merging to master and 2.1. |
…orrectly ## What changes were proposed in this pull request? `DataStreamReaderWriterSuite` makes test files in source folder like the followings. Interestingly, the root cause is `withSQLConf` fails to reset `OptionalConfigEntry` correctly. In other words, it resets the config into `Some(undefined)`. ```bash $ git status Untracked files: (use "git add <file>..." to include in what will be committed) sql/core/%253Cundefined%253E/ sql/core/%3Cundefined%3E/ ``` ## How was this patch tested? Manual. ``` build/sbt "project sql" test git status ``` Author: Dongjoon Hyun <dongjoon@apache.org> Closes#16522 from dongjoon-hyun/SPARK-19137. (cherry picked from commit d5b1dc9) Signed-off-by: Shixiong Zhu <shixiong@databricks.com>
dongjoon-hyun
commented
Jan 10, 2017
…orrectly ## What changes were proposed in this pull request? `DataStreamReaderWriterSuite` makes test files in source folder like the followings. Interestingly, the root cause is `withSQLConf` fails to reset `OptionalConfigEntry` correctly. In other words, it resets the config into `Some(undefined)`. ```bash $ git status Untracked files: (use "git add <file>..." to include in what will be committed) sql/core/%253Cundefined%253E/ sql/core/%3Cundefined%3E/ ``` ## How was this patch tested? Manual. ``` build/sbt "project sql" test git status ``` Author: Dongjoon Hyun <dongjoon@apache.org> Closesapache#16522 from dongjoon-hyun/SPARK-19137.
…orrectly ## What changes were proposed in this pull request? `DataStreamReaderWriterSuite` makes test files in source folder like the followings. Interestingly, the root cause is `withSQLConf` fails to reset `OptionalConfigEntry` correctly. In other words, it resets the config into `Some(undefined)`. ```bash $ git status Untracked files: (use "git add <file>..." to include in what will be committed) sql/core/%253Cundefined%253E/ sql/core/%3Cundefined%3E/ ``` ## How was this patch tested? Manual. ``` build/sbt "project sql" test git status ``` Author: Dongjoon Hyun <dongjoon@apache.org> Closesapache#16522 from dongjoon-hyun/SPARK-19137.
What changes were proposed in this pull request?
DataStreamReaderWriterSuitemakes test files in source folder like the followings. Interestingly, the root cause iswithSQLConffails to resetOptionalConfigEntrycorrectly. In other words, it resets the config intoSome(undefined).How was this patch tested?
Manual.