andylam-db opened a new pull request, #57172:
URL: https://github.com/apache/spark/pull/57172
### What changes were proposed in this pull request?
This PR removes the `--ONLY_IF spark` directive from the IN/EXISTS subquery
golden-file tests under
`sql/core/src/test/resources/sql-tests/inputs/subquery/` and rewrites their
temporary-view DDL from the Spark-specific
```sql
create temporary view t1 as select * from values
("t1a", 6S, 8, 10L, float(15.0), 20D, 20E2BD, ...) as t1(t1a, t1b, ...);
```
form into the portable
```sql
create temporary view t1(t1a, t1b, ...) as values
('t1a', 6, 8, 10, 15.0, 20.0, 2000.0, ...);
```
form, using ANSI-compatible literals (single-quoted strings, no
`S`/`L`/`D`/`E2BD` type suffixes). This lets the same query files run against
PostgreSQL through `CrossDbmsQueryTestSuite` instead of being skipped by the
`--ONLY_IF spark` guard.
It also adds debug/error logging to `CrossDbmsQueryTestSuite` so that
per-query SQL-text and result mismatches between Spark and the reference DBMS
are easier to diagnose.
Files touched:
- `connector/.../CrossDbmsQueryTestSuite.scala` — logging only.
- 18 `subquery/{in,exists}-subquery/*.sql` input files — remove `--ONLY_IF
spark`, portable DDL.
### Why are the changes needed?
The subquery test inputs were guarded by `--ONLY_IF spark`, so they never
exercised the cross-DBMS path. Their view DDL relied on Spark-only syntax
(typed literal suffixes, `select * from values ... as t(...)`) that PostgreSQL
rejects. Making the DDL portable lets these tests validate Spark's subquery
semantics against PostgreSQL as an independent oracle, catching correctness
divergences.
### Does this PR introduce _any_ user-facing change?
No. Test-only change.
### How was this patch tested?
Existing golden-file tests. The golden `.out` files are regenerated with
`SPARK_GENERATE_GOLDEN_FILES=1` and the PostgreSQL cross-DBMS run is exercised
via `CrossDbmsQueryTestSuite`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Anthropic)
--
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]