Skip to content

HIVE-30034: Add TPCDS planner tests for Iceberg tables - #6781

Open
zabetak wants to merge 9 commits into
apache:masterfrom
zabetak:HIVE-30034_02
Open

zabetak wants to merge 9 commits into
apache:masterfrom
zabetak:HIVE-30034_02

Conversation

@zabetak

@zabetak zabetak commented Sep 14, 2026

Copy link
Copy Markdown
Member

What changes were proposed in this pull request?

  • Add TPCDS planner tests for Iceberg tables backed by S3 container
  • Add S3Container using rustfs for tests that need s3a:// access
  • Add test driver, init script, and expected output files for all 99 TPCDS queries

Why are the changes needed?

For catching performance and functionality regressions of the query planner for Iceberg tables.

Does this PR introduce any user-facing change?

No

How was this patch tested?

mvn test -Dtest=TestTPCDSIcebergCliDriver

@zabetak

zabetak commented Sep 16, 2026

Copy link
Copy Markdown
Member Author

conf.put(HiveConf.ConfVars.PRE_EXEC_HOOKS, "");
conf.put(HiveConf.ConfVars.POST_EXEC_HOOKS, "");
// Disable merge join conversion cause it triggers very slow S3 list
// operations. Check to reenable later

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.

nit: "Check to reenable later" maybe worth a TODO here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Logged https://issues.apache.org/jira/browse/HIVE-30070 and replaced comment with JIRA reference: c000403

setCleanupScript("q_test_cleanup_tez.sql");
S3Container.BucketSpec bucketSpec = new S3Container.BucketSpec(
"dw-team-bucket/data/warehouse/tablespace/external/hive/tpcds_partitioned_iceberg_parquet_10000.db",
"https://github.com/zabetak/hive-test-datasets/releases/download/1.1/iceberg_s3_tpcds10tb.zip");

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.

is it ok to have a personal repo here?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For the moment yes! My personal repo is also used in: standalone-metastore/metastore-server/docker/hive-postgres-tpcds-metastore/Dockerfile

Once I find time, I will try to migrate those to the apache namespace as per discussion: https://lists.apache.org/thread/wdmnhk1tg42vxbpsjz1jc309l2shmr23

public TPCDSIcebergS3CliConfig() {
super(CorePerfCliDriver.class);
setQueryDir("ql/src/test/queries/clientpositive/perf");
setLogDir("itests/qtest/target/qfile-results/clientpositive/perf/tpcds1tb/iceberg");

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.

LogDir and ResultsDir say ".../tpcds1tb/..." (1TB); but below, the bucketSpec is tpcds_partitioned_iceberg_parquet_10000.db and iceberg_s3_tpcds10tb.zip (10TB); is this an inconsistency?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This runs with the 10TB dataset so I fixed the typos: 0399773

String bucketName;
URL dataUrl;

public BucketSpec(String bucketName, String dataUrl) {

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.

nit: why not simply passing bucket and keyPrefix as constructor arguments (and have them as separate final fields), so that we wouldn't need the extra substr logic on the getters (we wouldn't need the getters at all in fact)?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. I simplified a lot this class in f8c64aa

testArguments.setCleanupScript(cleanupScript);
testArguments.setWithLlapIo(withLlapIo);

testArguments.s3BucketSpec = this.s3BucketSpec;

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.

nit: for consistency with the existing code, this should be done via a setter.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed 8840a32


private void setupS3(HiveConf conf) {
S3Container.BucketSpec bucket = testArgs.getS3BucketSpec();
if(bucket == null) {

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.

nit: missing space after if

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed 9ac3296


private static final Logger LOG = LoggerFactory.getLogger(S3Container.class);
private static final DockerImageName RUSTFS_IMAGE =
DockerImageName.parse("rustfs/rustfs:v1.0.0-rc.5-glibc");

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.

Could we use 1.0.0 (which seems it was released just yesterday: https://github.com/rustfs/rustfs/releases#release-1.0.0) instead of a RC?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed b6abc29

setResultsDir("ql/src/test/results/clientpositive/perf/tpcds1tb/iceberg");

setInitScript("q_init_tpcds_iceberg.sql");
setCleanupScript("q_test_cleanup_tez.sql");

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.

just double-checking: is this existing cleanup script sufficient for this new test case?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed e35b69d

I have the impression that all cleanup scripts are redundant because every test runs in its own JVM so the whole process comes down after the execution.

- Add TPCDS planner tests for Iceberg tables backed by S3 container
- Add S3Container using rustfs for tests that need s3a:// access
- Add test driver, init script, and expected output files for all 99 TPCDS queries
Even if the tmp file is not deleted by the JVM it will be cleaned during the maven clean lifecycle.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants