Github user wzhfy commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14712#discussion_r76386878
  
    --- Diff: 
sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveExternalCatalog.scala ---
    @@ -401,6 +401,13 @@ private[spark] class HiveExternalCatalog(conf: 
SparkConf, hadoopConf: Configurat
         }
       }
     
    +  override def alterTableStats(tableDefinition: CatalogTable): Unit = 
withClient {
    --- End diff --
    
    Now I remember why I add this method. If we've already run the analyze 
command, then we have Statistics having rowCount, say 100. Now we run alter 
table command to set "numRows" to 200 (without setting 
STATS_GENERATED_VIA_STATS_TASK to true). If we use the same alterTable method, 
since Statistics is defined, we will set numRows and 
STATS_GENERATED_VIA_STATS_TASK  into properties, just like we do for analyze 
command.
    Then, the parameters in Hive are numRows=100, 
STATS_GENERATED_VIA_STATS_TASK=true, COLUMN_STATS_ACCURATE=true, while the 
expected result would be numRows=200, STATS_GENERATED_VIA_STATS_TASK=false, 
COLUMN_STATS_ACCURATE=false


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to