cloud-fan commented on code in PR #36027:
URL: https://github.com/apache/spark/pull/36027#discussion_r964768062
##########
sql/hive/src/main/scala/org/apache/spark/sql/hive/client/HiveClientImpl.scala:
##########
@@ -1095,7 +1095,11 @@ private[hive] object HiveClientImpl extends Logging {
table.bucketSpec match {
case Some(bucketSpec) if !HiveExternalCatalog.isDatasourceTable(table) =>
hiveTable.setNumBuckets(bucketSpec.numBuckets)
- hiveTable.setBucketCols(bucketSpec.bucketColumnNames.toList.asJava)
Review Comment:
shall we just lower-case the bucket column names?
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/execution/SQLQuerySuite.scala:
##########
@@ -2694,6 +2694,23 @@ abstract class SQLQuerySuiteBase extends QueryTest with
SQLTestUtils with TestHi
}
}
}
+
+ test("SPARK-38717: Handle Hive's bucket spec case preserving behaviour") {
+ withTable("t") {
+ sql(
+ s"""
+ |CREATE TABLE t(
+ | c STRING,
+ | B_C STRING
+ |)
+ |PARTITIONED BY (p_c STRING)
+ |CLUSTERED BY (B_C) INTO 4 BUCKETS
+ |STORED AS PARQUET
+ |""".stripMargin)
+ val df = sql("SELECT * FROM t")
+ df.collect()
Review Comment:
let's test with `checkAnswer`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]