Skip to content

[Cloudberry] Add PQS, TLP and DQP test oracles - #1370

Merged
mrigger merged 1 commit into
sqlancer:mainfrom
roseduan:cloudberry-oracles
Oct 20, 2026
Merged

mrigger merged 1 commit into
sqlancer:mainfrom
roseduan:cloudberry-oracles

Conversation

@roseduan

Copy link
Copy Markdown
Contributor

Add the oracles PQS, HAVING, AGGREGATE, DISTINCT, GROUP_BY, QUERY_PARTITIONING and DQP. DQP runs each query under GPORCA and the PostgreSQL-based planner, and with join, aggregation and motion methods disabled, and checks that all plans return the same rows. The CI job now also runs TestCloudberryTLP, TestCloudberryPQS and TestCloudberryDQP.

GPORCA falls back to the PostgreSQL-based planner for queries with ONLY or whole-row references, so the new oracles and the NoREC and WHERE oracles no longer generate them.

Fix two places where CloudberryProvider ignored --cloudberry-oracle: it now skips databases with empty tables when an oracle requires rows, and enables generateOnlyKnown for PQS.

Add the oracles PQS, HAVING, AGGREGATE, DISTINCT, GROUP_BY,
QUERY_PARTITIONING and DQP. DQP runs each query under GPORCA and the
PostgreSQL-based planner, and with join, aggregation and motion methods
disabled, and checks that all plans return the same rows. The CI job
now also runs TestCloudberryTLP, TestCloudberryPQS and TestCloudberryDQP.

GPORCA falls back to the PostgreSQL-based planner for queries with
ONLY or whole-row references, so the new oracles and the NoREC and
WHERE oracles no longer generate them.

Fix two places where CloudberryProvider ignored --cloudberry-oracle:
it now skips databases with empty tables when an oracle requires rows,
and enables generateOnlyKnown for PQS.

Work around the Cloudberry bugs found by these oracles:
- apache/cloudberry#2134: expect the errors of a PAX table broken by
  REINDEX DATABASE CONCURRENTLY
- apache/cloudberry#2135: do not generate CREATE STATISTICS, which can
  crash the coordinator
- apache/cloudberry#2137: do not generate SET wal_compression, which
  crashes the mirrors

Also expect the error raised when a redistributed table has an
inheritance child with an incompatible UNIQUE index.
@roseduan

Copy link
Copy Markdown
Contributor Author

I add some necessary test suites for Apache Cloudberry, please review it when you are free. Thanks a lot!
@mrigger

@mrigger mrigger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thank you!

assertEquals(0,
Main.executeMain(new String[] { "--random-seed", "0", "--timeout-seconds", TestConfig.SECONDS,
"--num-threads", "4", "--num-queries", TestConfig.NUM_QUERIES, "--username", "gpadmin",
"cloudberry", "--connection-url", "postgresql://localhost:7000/test", "--test-collations",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Regarding the port, perhaps we could subsequently encode this as a constant somewhere? Not sure, but I remember we also had a common option for this.

@mrigger
mrigger merged commit 11d9c9a into sqlancer:main Oct 20, 2026
24 of 26 checks passed
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