Skip to content

[SPARK-46179 FOLLOW UP][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing#57172

Open
andylam-db wants to merge 2 commits into
apache:masterfrom
andylam-db:andylam-db/postgres-subquery-tests
Open

[SPARK-46179 FOLLOW UP][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing#57172
andylam-db wants to merge 2 commits into
apache:masterfrom
andylam-db:andylam-db/postgres-subquery-tests

Conversation

@andylam-db

@andylam-db andylam-db commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

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

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

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 query files run against PostgreSQL through CrossDbmsQueryTestSuite.

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)

…sts to enable PostgreSQL cross-DBMS testing

Remove the `--ONLY_IF spark` guard from the IN/EXISTS subquery golden-file
tests and rewrite their temporary-view DDL into the portable
`CREATE TEMPORARY VIEW t(cols) AS VALUES ...` form with ANSI-compatible
literals, so the same query files can run against PostgreSQL under
CrossDbmsQueryTestSuite. Also add debug/error logging to
CrossDbmsQueryTestSuite to make per-query cross-DBMS mismatches easier to
diagnose.

Golden .out files still need to be regenerated with
SPARK_GENERATE_GOLDEN_FILES=1.
@andylam-db andylam-db changed the title [WIP][SPARK-XXXXX][SQL][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing [SQL][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing Jul 9, 2026
Generated with SPARK_GENERATE_GOLDEN_FILES=1 after removing --ONLY_IF spark
and rewriting the temporary-view DDL to the portable CREATE TEMPORARY VIEW
t(cols) AS VALUES form. The literal-type changes (dropping S/L/float/BD
suffixes) shift column types (smallint->int, float/double->decimal), which
is reflected in the regenerated schemas.
@andylam-db andylam-db marked this pull request as ready for review July 9, 2026 23:39

@dongjoon-hyun dongjoon-hyun left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to file a JIRA issue before making it ready, @andylam-db .

@dongjoon-hyun dongjoon-hyun marked this pull request as draft July 9, 2026 23:47
@andylam-db andylam-db changed the title [SQL][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing [SPARK-46179 FOLLOW UP][TESTS] Remove --ONLY_IF spark from subquery SQL tests to enable PostgreSQL cross-DBMS testing Jul 9, 2026
@andylam-db andylam-db marked this pull request as ready for review July 9, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants