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

Create golden file test framework for analysis

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.5.0
    • SQL
    • None

    Description

      Here we track the work to add new golden file test support for the Spark analyzer. Each golden file can contain a list of SQL queries followed by the string representations of their analyzed logical plans.
       
      This can be similar to Spark's existing `SQLQueryTestSuite` [1], but stopping after analysis and listing analyzed plans as the results instead of fully executing queries end-to-end. As another example, ZetaSQL has analyzer-based golden file testing like this as well [2].
       
      This way, any changes to analysis will show up as test diffs, which are easy to spot in review and also easy to update automatically. This could help the community together maintain the qualify of Apache Spark's query analysis.
       
      [1] https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/SQLQueryTestSuite.scala 
      [2] https://github.com/google/zetasql/blob/master/zetasql/analyzer/testdata/limit.test.
       

      Attachments

        Activity

          People

            dtenedor Daniel
            dtenedor Daniel
            Gengliang Wang Gengliang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: