Uh oh!
There was an error while loading. Please reload this page.
[SPARK-23072][SQL][TEST] Add a Unicode schema test for file-based data sources - #20266
[SPARK-23072][SQL][TEST] Add a Unicode schema test for file-based data sources#20266dongjoon-hyun wants to merge 7 commits into
Conversation
SparkQA
commented
Jan 14, 2018
Test build #86122 has finished for PR 20266 at commit
|
dongjoon-hyun
commented
Jan 14, 2018
cc @gatorsmile and @cloud-fan . |
| } | ||
| Seq("orc", "parquet", "csv", "json").foreach { format => | ||
| test(s"Write and read back unicode schema - $format") { |
There was a problem hiding this comment.
instead of keeping adding test cases in SQLQuerySuite, shall we create a dedicate test suite for file based data source now?
There was a problem hiding this comment.
+1. That's a best idea. I'll update like that.
SparkQA
commented
Jan 15, 2018
Test build #86140 has finished for PR 20266 at commit
|
SparkQA
commented
Jan 15, 2018
Test build #86141 has finished for PR 20266 at commit
|
| Seq("orc", "parquet", "csv", "json", "text").foreach { format => | ||
| test(s"Writing empty datasets should not fail - $format") { | ||
| withTempDir { dir => | ||
| Seq("str").toDS.limit(0).write.format(format).save(dir.getCanonicalPath + "/tmp") |
There was a problem hiding this comment.
nit: why add /tmp at the end?
There was a problem hiding this comment.
Yep. It's fixed by using withTempPath.
| } | ||
| // Only New OrcFileFormat supports this | ||
| Seq(classOf[org.apache.spark.sql.execution.datasources.orc.OrcFileFormat].getCanonicalName, |
There was a problem hiding this comment.
spark.sql.orc.impl is native by default, can we just use "orc" here?
cloud-fan
commented
Jan 16, 2018
LGTM |
SparkQA
commented
Jan 16, 2018
Test build #86159 has finished for PR 20266 at commit
|
cloud-fan
commented
Jan 16, 2018
retest this please |
SparkQA
commented
Jan 16, 2018
Test build #86162 has finished for PR 20266 at commit
|
mgaido91
commented
Jan 16, 2018
nit: since we are creating a new test suite what about moving also https://github.com/dongjoon-hyun/spark/blob/5afaa2836133cfc18a52de38d666817991d62c5d/sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala#L1347 there? |
dongjoon-hyun
commented
Jan 16, 2018
Retest this please |
SparkQA
commented
Jan 16, 2018
Test build #86178 has started for PR 20266 at commit |
@mgaido91 . That suite is using SQL Syntax and Hive metastore. Here, it's only using in-memory catalog. |
mgaido91
commented
Jan 16, 2018
@dongjoon-hyun the test case I referred to (the one related to SPARK-22146) doesn't seem to use either of them to me. It is only about reading files with special chars. |
Oh, I thought you mentioned the suite, @mgaido91 . Sorry! I agree with you. |
dongjoon-hyun
commented
Jan 16, 2018
Anyway, Jenkins seems to be out of order now. |
SparkQA
commented
Jan 16, 2018
Test build #86183 has finished for PR 20266 at commit
|
SparkQA
commented
Jan 16, 2018
Test build #86184 has finished for PR 20266 at commit
|
mgaido91
commented
Jan 16, 2018
LGTM |
| } | ||
| Seq("orc", "parquet", "csv", "json").foreach { format => | ||
| test(s"SPARK-23072 Write and read back unicode schema - $format") { |
There was a problem hiding this comment.
unicode schema -> unicode column names
| } | ||
| } | ||
| Seq("orc", "parquet").foreach { format => |
There was a problem hiding this comment.
Only these two formats support it? If so, please add the comments.
This is the same comment to the other test cases. Otherwise, add all of them for each test case.
You can define a global Seq to include all the built-in file formats we support.
There was a problem hiding this comment.
Thanks!
- Only two support this. I added comments.
- For the other test cases, I did.
- I added a global Seq,
allFileBasedDataSources.
SparkQA
commented
Jan 17, 2018
Test build #86227 has finished for PR 20266 at commit
|
cloud-fan
commented
Jan 17, 2018
thanks, merging to master/2.3! |
…a sources ## What changes were proposed in this pull request? After [SPARK-20682](#19651), Apache Spark 2.3 is able to read ORC files with Unicode schema. Previously, it raises `org.apache.spark.sql.catalyst.parser.ParseException`. This PR adds a Unicode schema test for CSV/JSON/ORC/Parquet file-based data sources. Note that TEXT data source only has [a single column with a fixed name 'value'](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/text/TextFileFormat.scala#L71). ## How was this patch tested? Pass the newly added test case. Author: Dongjoon Hyun <dongjoon@apache.org> Closes#20266 from dongjoon-hyun/SPARK-23072. (cherry picked from commit a0aedb0) Signed-off-by: Wenchen Fan <wenchen@databricks.com>
dongjoon-hyun
commented
Jan 17, 2018
Thank you, @cloud-fan , @gatorsmile , and @mgaido91 ! |
What changes were proposed in this pull request?
After SPARK-20682, Apache Spark 2.3 is able to read ORC files with Unicode schema. Previously, it raises
org.apache.spark.sql.catalyst.parser.ParseException.This PR adds a Unicode schema test for CSV/JSON/ORC/Parquet file-based data sources. Note that TEXT data source only has a single column with a fixed name 'value'.
How was this patch tested?
Pass the newly added test case.