sunchao commented on code in PR #43629:
URL: https://github.com/apache/spark/pull/43629#discussion_r1387343974


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -2671,6 +2671,16 @@ object SQLConf {
       .booleanConf
       .createWithDefault(false)
 
+  val ANALYZE_PARTITION_STATS_ENABLED =
+    buildConf("spark.sql.statistics.update.partitionStats.enabled")

Review Comment:
   Hmm, how about 
`spark.sql.statistics.updatePartitionStatsInAnalyzeTable.enabled`? it is a bit 
long but can fully expression the intention 😂 



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala:
##########
@@ -2671,6 +2671,16 @@ object SQLConf {
       .booleanConf
       .createWithDefault(false)
 
+  val ANALYZE_PARTITION_STATS_ENABLED =
+    buildConf("spark.sql.statistics.update.partitionStats.enabled")

Review Comment:
   Hmm, how about 
`spark.sql.statistics.updatePartitionStatsInAnalyzeTable.enabled`? it is a bit 
long but can fully expression the intention 😂 



##########
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:
   oops will revert this change



-- 
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]

Reply via email to