dongjoon-hyun opened a new pull request, #60693:
URL: https://github.com/apache/spark/pull/60693
### What changes were proposed in this pull request?
This PR aims to tag 23 more test suites of `sql/core` with
`DataSourceV2Test`, so that they run in `sql - DSv2 tests` instead of the other
`sql` test groups.
SPARK-61685 tagged the DSv2 test suites by package and name, and excluded
the Structured Streaming suites, including
`org.apache.spark.sql.execution.datasources.v2.state`. This PR tags the
remaining suites that test DSv2 only and run no DSv1 code (no V1 relations, no
V1 file sources, and no V1 streaming `Source`/`Sink` such as `FileStreamSink`
and `ForeachBatchSink`).
- Batch suites outside the DSv2 packages
- `FileScanSuite`: the equality of the DSv2 `FileScan` implementations
(`ParquetScan`, `OrcScan`, `CSVScan`, `JsonScan`, and `TextScan`)
- `InMemoryTableMetricSuite`: the DSv2 write metrics of `InMemoryTable`
- `AlignMergeAssignmentsSuite` and `AlignUpdateAssignmentsSuite`: the
assignment alignment of DSv2 row-level `MERGE` and `UPDATE` on
`SupportsRowLevelOperations` tables
- Structured Streaming suites
- All 16 suites of `org.apache.spark.sql.execution.datasources.v2.state`,
which test the state data source (a DSv2 `TableProvider`) with `MemoryStream`,
`MemorySink`, and the `noop` sink. Three of them had old tags, which are
replaced.
- `StateDataSourceTransformWithStateSuite` (`SlowSQLTest`)
- `StateDataSourceTransformWithStateSuiteCheckpointV2`
(`ExtendedSQLTest`)
- `StateDataSourceTransformWithStateSuiteWithRowChecksum`
(`ExtendedSQLTest`)
- `StreamingV2ScanPushDownRealTimeSuite`: the DSv2 scan pushdown of
real-time queries
- `StreamingRealTimeModeSourceCompatSuite`: the compatibility of the DSv2
`SupportsRealTimeRead` API
- `ReportSinkMetricsSuite`: the DSv2 `ReportsSinkMetrics` API
The following DSv2-related suites are not tagged because they also run DSv1
code.
- `FileStreamSinkV2Suite`: the V1 `FileStreamSink`
- `StreamingDataSourceV2Suite`: the fallback to a V1 `Sink`
- `PythonDataSourceSuite`, `PythonStreamingDataSourceSimpleSuite`,
`PythonStreamingDataSourceSuite`, and `PythonStreamingDataSourceWriteSuite`:
the V1 JSON file sink and reader, and `foreachBatch`, to collect and verify the
results
- `StreamingV2ScanPushDownSuite`: `foreachBatch` in a test case
### Why are the changes needed?
`sql - DSv2 tests` is still the shortest `sql` test job by far. For example,
the `sql` jobs of a recent run,
[44382867865](https://github.com/dongjoon-hyun/spark/actions/runs/44382867865)
(2026-11-18), took the following time.
| Job | Duration |
|---|---|
| `sql - extended tests` | 2h 04m |
| `sql - other tests` | 1h 55m |
| `sql - slow tests` | 1h 33m |
| `sql - DSv2 tests` | 47m |
The following is the sum of the suite times (minutes) of each group,
recomputed from the JUnit reports of the same run with the suites regrouped by
this PR.
| | extended | slow | other | DSv2 |
|---|---|---|---|---|
| Before | 114.9 | 86.5 | 105.5 | 34.9 |
| After | 110.4 | 84.7 | 97.9 | 48.8 |
### Does this PR introduce _any_ user-facing change?
No, this is a test-only change.
### How was this patch tested?
- Pass the CIs.
- Compile the test code and run Scalastyle.
```
$ build/sbt sql/Test/compile sql/Test/scalastyle
```
- Run the suites with the same system properties that `dev/run-tests` passes
to SBT, and check which tests run.
```
$ build/sbt -Dtest.include.tags=org.apache.spark.tags.DataSourceV2Test
"sql/testOnly org.apache.spark.sql.FileScanSuite
org.apache.spark.sql.execution.datasources.InMemoryTableMetricSuite
org.apache.spark.sql.execution.command.AlignMergeAssignmentsSuite
org.apache.spark.sql.execution.command.AlignUpdateAssignmentsSuite
org.apache.spark.sql.execution.datasources.v2.state.StateDataSourceRealTimeSuite
org.apache.spark.sql.streaming.StreamingRealTimeModeSourceCompatSuite
org.apache.spark.sql.streaming.ReportSinkMetricsSuite"
...
[info] Tests: succeeded 74, failed 0, canceled 0, ignored 0, pending 0
```
```
$ build/sbt
-Dtest.exclude.tags=org.apache.spark.tags.ExtendedSQLTest,org.apache.spark.tags.SlowSQLTest,org.apache.spark.tags.DataSourceV2Test
"sql/testOnly org.apache.spark.sql.FileScanSuite
org.apache.spark.sql.execution.datasources.InMemoryTableMetricSuite
org.apache.spark.sql.execution.command.AlignMergeAssignmentsSuite
org.apache.spark.sql.execution.command.AlignUpdateAssignmentsSuite
org.apache.spark.sql.execution.datasources.v2.state.*
org.apache.spark.sql.streaming.StreamingV2ScanPushDownRealTimeSuite
org.apache.spark.sql.streaming.StreamingRealTimeModeSourceCompatSuite
org.apache.spark.sql.streaming.ReportSinkMetricsSuite"
...
[info] Total number of tests run: 0
[info] Suites: completed 23, aborted 0
```
```
$ build/sbt
-Dtest.include.tags=org.apache.spark.tags.ExtendedSQLTest,org.apache.spark.tags.SlowSQLTest
"sql/testOnly <the same 23 suites>"
...
[info] Total number of tests run: 0
[info] Suites: completed 23, aborted 0
```
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]