Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-27266

Support ANALYZE TABLE to collect tables stats for cached catalog views

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.0.0
    • 3.0.0
    • SQL
    • None

    Description

      The master doesn't support ANALYZE TABLE to collect tables stats for catalog views even if they are cached;

      scala> sql(s"CREATE VIEW v AS SELECT 1 c")
      scala> sql(s"CACHE LAZY TABLE v")
      scala> sql(s"ANALYZE TABLE v COMPUTE STATISTICS")
      org.apache.spark.sql.AnalysisException: ANALYZE TABLE is not supported on views.;
      
        at org.apache.spark.sql.execution.command.AnalyzeTableCommand.run(AnalyzeTableCommand.scala:38)
      
        at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult$lzycompute(commands.scala:70)
      
        at org.apache.spark.sql.execution.command.ExecutedCommandExec.sideEffectResult(commands.scala:68)
      
        at org.apache.spark.sql.execution.command.ExecutedCommandExec.executeCollect(commands.scala:79)

      Since SPARK-25196 has supported an ANALYZE command to collect column statistics for cached catalog view, we could support table stats, too.

      Attachments

        Issue Links

          Activity

            People

              maropu Takeshi Yamamuro
              maropu Takeshi Yamamuro
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: