dongjoon-hyun commented on code in PR #43629:
URL: https://github.com/apache/spark/pull/43629#discussion_r1387340831
##########
sql/hive/src/test/scala/org/apache/spark/sql/hive/StatisticsSuite.scala:
##########
@@ -372,54 +372,70 @@ class StatisticsSuite extends
StatisticsCollectionTestBase with TestHiveSingleto
partition.stats
}
- withTable(tableName) {
- withTempPath { path =>
- // Create a table with 3 partitions all located under a single
top-level directory 'path'
- sql(
- s"""
- |CREATE TABLE $tableName (key STRING, value STRING)
- |USING hive
- |PARTITIONED BY (ds STRING)
- |LOCATION '${path.toURI}'
- """.stripMargin)
+ Seq(true, false).foreach { partitionStatsEnabled =>
+ withSQLConf(SQLConf.ANALYZE_PARTITION_STATS_ENABLED.key ->
partitionStatsEnabled.toString) {
+ withTable(tableName) {
+ withTempPath { path =>
+ // Create a table with 3 partitions all located under a directory
'path'
+ sql(
+ s"""
+ |CREATE TABLE $tableName (key STRING, value STRING)
+ |USING hive
+ |PARTITIONED BY (ds STRING)
+ |LOCATION '${path.toURI}'
+ """.stripMargin)
- val partitionDates = List("2010-01-01", "2010-01-02", "2010-01-03")
+ val partitionDates = List("2010-01-01", "2010-01-02", "2010-01-03")
- partitionDates.foreach { ds =>
- sql(s"ALTER TABLE $tableName ADD PARTITION (ds='$ds') LOCATION
'$path/ds=$ds'")
- sql("SELECT * FROM src").write.mode(SaveMode.Overwrite)
- .format("parquet").save(s"$path/ds=$ds")
- }
+ partitionDates.foreach { ds =>
+ sql(s"ALTER TABLE $tableName ADD PARTITION (ds='$ds') LOCATION
'$path/ds=$ds'")
+ sql("SELECT * from src").write.mode(SaveMode.Overwrite)
Review Comment:
Let's keep the original. It was `FROM` instead of `from`..
--
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]