Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/6583#discussion_r31517920
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/sources/hadoopFsRelationSuites.scala
---
@@ -453,6 +456,20 @@ abstract class HadoopFsRelationTest extends QueryTest
with SQLTestUtils {
}
}
}
+
+ test("SPARK-7616: adjust column name order accordingly when saving
partitioned table") {
+ val df = (1 to 3).map(i => (i, s"val_$i", i * 2)).toDF("a", "b", "c")
+
+ df.write
+ .format(dataSourceName)
+ .mode(SaveMode.Overwrite)
+ .partitionBy("c", "a")
+ .saveAsTable("t")
+
+ withTable("t") {
+ checkAnswer(table("t"), df.select('b, 'c, 'a).collect())
+ }
+ }
--- End diff --
Moved this test case here so that it gets executed for all test suite that
extend `HadoopFsRelationTest`.
---
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]