Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/9226#discussion_r43036472
--- Diff:
sql/hive/src/test/scala/org/apache/spark/sql/hive/MetastoreDataSourcesSuite.scala
---
@@ -744,32 +744,6 @@ class MetastoreDataSourcesSuite extends QueryTest with
SQLTestUtils with TestHiv
}
}
- test("Saving partition columns information") {
- val df = (1 to 10).map(i => (i, i + 1, s"str$i", s"str${i +
1}")).toDF("a", "b", "c", "d")
- val tableName = s"partitionInfo_${System.currentTimeMillis()}"
-
- withTable(tableName) {
- df.write.format("parquet").partitionBy("d",
"b").saveAsTable(tableName)
- invalidateTable(tableName)
- val metastoreTable = catalog.client.getTable("default", tableName)
- val expectedPartitionColumns = StructType(df.schema("d") ::
df.schema("b") :: Nil)
- val actualPartitionColumns =
- StructType(
- metastoreTable.partitionColumns.map(c =>
- StructField(c.name,
HiveMetastoreTypes.toDataType(c.hiveType))))
- // Make sure partition columns are correctly stored in metastore.
- assert(
- expectedPartitionColumns.sameType(actualPartitionColumns),
- s"Partitions columns stored in metastore $actualPartitionColumns
is not the " +
- s"partition columns defined by the saveAsTable operation
$expectedPartitionColumns.")
-
- // Check the content of the saved table.
- checkAnswer(
- table(tableName).select("c", "b", "d", "a"),
- df.select("c", "b", "d", "a"))
- }
- }
-
--- End diff --
Can we have a test to check the text contents of partition columns in the
table properties?
---
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]