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

DataSourceV2 should expose row count and attribute statistics

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Incomplete
    • 2.3.0
    • None
    • SQL

    Description

      During investigation of CBO and DataSourceV2 we found, that

      org.apache.spark.sql.sources.v2.reader.Statistics
      

      misses attribute/column statistics and that

      DataSourceV2Relation#computeStats
      

      wraps

      org.apache.spark.sql.sources.v2.reader.Statistics
      

      into

      org.apache.spark.sql.catalyst.plans.logical.Statistics
      

      without forwarding the optional rowCount if present.

      However rowCount and attributeStats are used during CBO e.g. in JoinEstimation and AggregateEstimation.

      We propose that:

      • org.apache.spark.sql.sources.v2.reader.Statistics mirrors org.apache.spark.sql.catalyst.plans.logical.Statistics
      • DataSourceV2Relation forwards all the information to be available during CBO

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mju Martin Junghanns
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: