Daniel created SPARK-42791:
------------------------------

             Summary: Create golden file test framework for analysis
                 Key: SPARK-42791
                 URL: https://issues.apache.org/jira/browse/SPARK-42791
             Project: Spark
          Issue Type: Improvement
          Components: SQL
    Affects Versions: 3.4.0
            Reporter: Daniel


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



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to