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

    https://github.com/apache/spark/pull/15090#discussion_r79965370
  
    --- Diff: 
sql/core/src/main/scala/org/apache/spark/sql/internal/SessionState.scala ---
    @@ -186,13 +187,27 @@ private[sql] class SessionState(sparkSession: 
SparkSession) {
       }
     
       /**
    -   * Analyzes the given table in the current database to generate 
statistics, which will be
    +   * Analyzes the given table in the current database to generate 
table-level statistics, which
    +   * will be used in query optimizations.
    +   */
    +  def analyzeTable(tableIdent: TableIdentifier, noscan: Boolean = true): 
Unit = {
    +    AnalyzeTableCommand(tableIdent, noscan).run(sparkSession)
    +  }
    +
    +  /**
    +   * Analyzes the given columns in the table to generate column-level 
statistics, which will be
        * used in query optimizations.
    -   *
    -   * Right now, it only supports catalog tables and it only updates the 
size of a catalog table
    -   * in the external catalog.
        */
    -  def analyze(tableName: String, noscan: Boolean = true): Unit = {
    -    AnalyzeTableCommand(tableName, noscan).run(sparkSession)
    +  def analyzeTableColumns(tableIdent: TableIdentifier, columnNames: 
Seq[String]): Unit = {
    +    AnalyzeColumnCommand(tableIdent, columnNames).run(sparkSession)
    +  }
    +
    +  // This api is used for testing.
    +  def computeColumnStats(tableName: String, columnNames: Seq[String]): 
Map[String, ColumnStats] = {
    --- End diff --
    
    Avoid adding any testing-only API, if possible.


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