Skip to content

[native] Use builder pattern for native queryRunner#25120

Merged
pramodsatya merged 1 commit intoprestodb:masterfrom
pramodsatya:bldr_nativeqr
Jun 2, 2025
Merged

[native] Use builder pattern for native queryRunner#25120
pramodsatya merged 1 commit intoprestodb:masterfrom
pramodsatya:bldr_nativeqr

Conversation

@pramodsatya
Copy link
Contributor

@pramodsatya pramodsatya commented May 15, 2025

Description

Consolidate various methods in PrestoNativeQueryRunnerUtils used to create query runners for native e2e tests using builder pattern.

Motivation and Context

PrestoNativeQueryRunnerUtils currently has multiple overloaded methods to create (native | java) (hive | iceberg) query runner using different arguments. All of these overloaded methods use a common function to create the query runner, while allowing developers to modify a set of configs via function arguments and retaining the default values for remaining configs. Moving these parameters to a builder pattern, following the example of IcebergQueryRunner, will consolidate the different createQueryRunner methods and improve readability for the configs being set in different test suites.

== NO RELEASE NOTE ==

@prestodb-ci prestodb-ci added the from:IBM PR from IBM label May 15, 2025
@pramodsatya pramodsatya force-pushed the bldr_nativeqr branch 3 times, most recently from 9d9e72c to c8c9a74 Compare May 20, 2025 01:09
@pramodsatya pramodsatya marked this pull request as ready for review May 20, 2025 18:51
@pramodsatya pramodsatya requested a review from a team as a code owner May 20, 2025 18:51
@prestodb-ci prestodb-ci requested review from a team, BryanCutler and infvg and removed request for a team May 20, 2025 18:51
@tdcmeehan
Copy link
Contributor

Thank you for working on this!

@pramodsatya pramodsatya force-pushed the bldr_nativeqr branch 3 times, most recently from 47517a3 to 89564d4 Compare May 28, 2025 06:35
@pramodsatya
Copy link
Contributor Author

Thanks for the feedback @tdcmeehan, @ZacBlanco, @aditi-pandit, addressed the review comments. Could you please take another look?

Copy link
Contributor

@ZacBlanco ZacBlanco left a comment

Choose a reason for hiding this comment

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

One comment, otherwise lgtm

Copy link
Contributor

@BryanCutler BryanCutler left a comment

Choose a reason for hiding this comment

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

LGTM, just a couple minor nits

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @pramodsatya. Have one comment, else this PR is looking good.

@pramodsatya
Copy link
Contributor Author

Thanks @aditi-pandit, @BryanCutler, @ZacBlanco, addressed the pending comments, could you please take another look?
I will squash the commits if changes look good.

.put("hive.storage-format", this.storageFormat)
.put("hive.pushdown-filter-enabled", "true")
.build());
this.tpcdsProperties.putAll(getNativeWorkerTpcdsProperties());
Copy link
Contributor

Choose a reason for hiding this comment

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

Its a bit odd this is getNativeWorkerTpcdsProperties as well. Please can you confirm.

You could write this code to move the common properties for the query runner outside of the if condition.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

getNativeWorkerTpcdsProperties() has config tpcds.use-varchar-type=true, which is needed in the java query runner to create Tpcds tables with Varchar columns for the native Tpcds e2e tests.
Moved the common properties outside the if condition, thanks for the suggestion! Could you please take another look?

Copy link
Contributor

@aditi-pandit aditi-pandit left a comment

Choose a reason for hiding this comment

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

Thanks @pramodsatya

@pramodsatya pramodsatya requested a review from ZacBlanco May 30, 2025 03:00
@pramodsatya
Copy link
Contributor Author

@tdcmeehan, could you please take another look?

@pramodsatya pramodsatya merged commit a12b523 into prestodb:master Jun 2, 2025
104 of 105 checks passed
@pramodsatya pramodsatya deleted the bldr_nativeqr branch September 10, 2025 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from:IBM PR from IBM

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants