feat: capture per-query output from CometSqlFileTestSuite via system property#3976
Draft
andygrove wants to merge 1 commit intoapache:mainfrom
Draft
feat: capture per-query output from CometSqlFileTestSuite via system property#3976andygrove wants to merge 1 commit intoapache:mainfrom
andygrove wants to merge 1 commit intoapache:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #.
Rationale for this change
When cross-checking Spark behavior across versions or against another engine, it is useful to see the actual row data returned by each query in the SQL test corpus, not just pass or fail. There was no built-in way to do this. Adding one lets us generate a machine-readable record of every query's result in one test run, which is much less fragile than extracting queries, re-running them in a separate session, and hand-formatting the output.
What changes are included in this PR?
CometSqlFileTestSuitehonors a new system property,comet.sqlFileTest.verboseOutput. When the property is set to a file path, the suite appends a markdown-formatted record for every query it runs. Each record contains the SQL file and line, the query mode (query,query spark_answer_only,query expect_error(...), etc.), the SQL text, and Spark's actual result rows or error message.VerboseOutputowns the file lifecycle. The file is created and header-stamped on the first write, then appended to for each subsequent query. Skipped files (for example those gated byMinSparkVersion) are not written to the output.docs/source/contributor-guide/sql-file-tests.mddocuments the flag, shows a concrete Maven invocation, and notes the JDK 17--add-opensargs that must be preserved when overridingargLine.When the property is not set the suite behaves exactly as before.
How are these changes tested?
Manually ran
./mvnw test -Dsuites="org.apache.comet.CometSqlFileTestSuite encode" -Dtest=none -DargLine="..."with and withoutcomet.sqlFileTest.verboseOutputset. With the property unset the suite output is unchanged. With the property pointed at/tmp/encode-spark-3.5-output.md, the file is created with a header and one markdown section per executed query, and the actual assertions still run in addition to the verbose capture.