Github user gatorsmile commented on a diff in the pull request:
https://github.com/apache/spark/pull/13486#discussion_r67580384
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/streaming/test/DataFrameReaderWriterSuite.scala
---
@@ -572,4 +572,16 @@ class DataFrameReaderWriterSuite extends StreamTest
with BeforeAndAfter {
cq.awaitTermination(2000L)
}
+
+ test("prevent all column partitioning") {
+ withTempDir { dir =>
+ val path = dir.getCanonicalPath
+ intercept[AnalysisException] {
+
spark.range(10).write.format("parquet").mode("overwrite").partitionBy("id").save(path)
+ }
+ intercept[AnalysisException] {
+
spark.range(10).write.format("orc").mode("overwrite").partitionBy("id").save(path)
--- End diff --
I am fine if you want to fix it. You can put it in `OrcSuite`. Then,
running the following command to verify whether it passes or not:
> build/sbt -Phive "hive/test-only
org.apache.spark.sql.hive.orc.OrcSourceSuite"
```scala
test("prevent all column partitioning") {
withTempDir { dir =>
val path = dir.getCanonicalPath
val e = intercept[AnalysisException] {
spark.range(10).write.format("orc").mode("overwrite").partitionBy("id").save(path)
}.getMessage
assert(e.contains("Cannot use all columns for partition columns"))
}
}
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]