Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for preview features #2923

Merged
merged 5 commits into from Oct 24, 2023
Merged

Conversation

obada-ab
Copy link
Member

@obada-ab obada-ab commented Oct 5, 2023

Enables preview query features, which currently only includes stateless queries (queries without jobId). These features won't always be enabled on the service side and there are additional checks and conditions.

Fixes #2949

@obada-ab obada-ab added the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 5, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. api: bigquery Issues related to the googleapis/java-bigquery API. labels Oct 5, 2023
@obada-ab obada-ab changed the title [DO NOT MERGE] feat: add jobCreationMode to QueryRequestInfo feat: add jobCreationMode to QueryRequestInfo Oct 6, 2023
@obada-ab obada-ab removed the do not merge Indicates a pull request not ready for merge, due to either quality or timing. label Oct 6, 2023
@obada-ab obada-ab marked this pull request as ready for review October 9, 2023 12:03
@obada-ab obada-ab requested review from a team as code owners October 9, 2023 12:03
@obada-ab obada-ab requested a review from tswast October 9, 2023 12:03
@obada-ab obada-ab added the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 12, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Oct 12, 2023
@tswast tswast requested review from shollyman and removed request for tswast October 13, 2023 21:02
@obada-ab obada-ab changed the title feat: add jobCreationMode to QueryRequestInfo feat: add support for preview features Oct 17, 2023
@@ -94,6 +95,21 @@ public enum Priority {
BATCH
}

/** Job Creation Mode provides different options on job creation. */
enum JobCreationMode {
Copy link
Contributor

Choose a reason for hiding this comment

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

So, I think the interesting question is whether we want to expose the enum and setter at all to users. It's only available on the jobs.query path so it feels a bit unusual to overload JobConfiguration with this.

Originally I envisioned the only control over the setting being the env variable, and the library would set it appropriately when we're on the fast query path. After preview we'd simply always set it on the fast query path, much like how the idempotence request ID is handled. If you truly want a job to be created, you can invoke the proper method that returns a job rather than an iterator.

The issue manifests here in some way as how the enum is documented. The default really isn't static in terms of the setter, as the client library is going to be setting values automatically so you need to potentially describe this either more ambiguously, or possibly use JOB_CREATION_MODE_UNSPECIFIED to describe the situations in which the library will set one value vs another.

I'm not sure I hold particularly strong views here, so I'd love to hear your thoughts.

Copy link
Member Author

Choose a reason for hiding this comment

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

@shollyman thanks for taking a look and bringing this up

I'm not entirely sure what you mean by "expose the enum and setter at all to users", users wouldn't be able to use the setter setJobCreationMode or the enum JobCreationMode since both are package-private. The only (relevant) external method added in this change is setQueryPreviewEnabled which I used for integration tests.

I added the enum/setter/documentation to make the internal client dev process a bit better, I am not sure how/when this part of the code would be changed/removed later on though.

If you still think some parts of the code/documentation should be removed please let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

My apologies, I missed the package private. That makes more sense.

@obada-ab
Copy link
Member Author

@shollyman @PhongChuong friendly ping

@obada-ab obada-ab added the automerge Merge the pull request once unit tests and other checks pass. label Oct 24, 2023
@gcf-merge-on-green gcf-merge-on-green bot merged commit 113b8f2 into main Oct 24, 2023
16 checks passed
@gcf-merge-on-green gcf-merge-on-green bot deleted the job-creation-mode branch October 24, 2023 09:22
@gcf-merge-on-green gcf-merge-on-green bot removed the automerge Merge the pull request once unit tests and other checks pass. label Oct 24, 2023
gcf-merge-on-green bot pushed a commit that referenced this pull request Oct 26, 2023
🤖 I have created a release *beep* *boop*
---


## [2.34.0](https://togithub.com/googleapis/java-bigquery/compare/v2.33.2...v2.34.0) (2023-10-26)


### Features

* Add BigLakeConfiguration Property in StandardTableDefinition.java  ([#2916](https://togithub.com/googleapis/java-bigquery/issues/2916)) ([1d660fa](https://togithub.com/googleapis/java-bigquery/commit/1d660fa19f0d82c2b6ec2ea9590881e513274c25))
* Add support for Dataset property storageBillingModel ([#2913](https://togithub.com/googleapis/java-bigquery/issues/2913)) ([f452cf4](https://togithub.com/googleapis/java-bigquery/commit/f452cf4e100b6cc211681a840ddbd0be5108d01e))
* Add support for preview features ([#2923](https://togithub.com/googleapis/java-bigquery/issues/2923)) ([113b8f2](https://togithub.com/googleapis/java-bigquery/commit/113b8f27419365c7277c6a300c5f07cea954cca1))


### Dependencies

* Update actions/checkout action to v4.1.1 ([#2950](https://togithub.com/googleapis/java-bigquery/issues/2950)) ([c556c18](https://togithub.com/googleapis/java-bigquery/commit/c556c1837baf0d53245452d6a152910df7883262))
* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.30.0 ([#2942](https://togithub.com/googleapis/java-bigquery/issues/2942)) ([e760fca](https://togithub.com/googleapis/java-bigquery/commit/e760fcae98b23ff4e7fc3ae25f2437be220e9df9))
* Update dependency com.google.api.grpc:proto-google-cloud-bigqueryconnection-v1 to v2.31.0 ([#2967](https://togithub.com/googleapis/java-bigquery/issues/2967)) ([7ed55b5](https://togithub.com/googleapis/java-bigquery/commit/7ed55b5c075dbac827c6201d0398ff87d8240b38))
* Update dependency com.google.apis:google-api-services-bigquery to v2-rev20231008-2.0.0 ([#2946](https://togithub.com/googleapis/java-bigquery/issues/2946)) ([3d0da5b](https://togithub.com/googleapis/java-bigquery/commit/3d0da5b5a20f49721477afbed10ea3fff43652bb))
* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.34.0 ([#2943](https://togithub.com/googleapis/java-bigquery/issues/2943)) ([18162c3](https://togithub.com/googleapis/java-bigquery/commit/18162c37c97eff6387e0f58d211f2c1725a9c8d3))
* Update dependency com.google.cloud:google-cloud-datacatalog-bom to v1.35.0 ([#2968](https://togithub.com/googleapis/java-bigquery/issues/2968)) ([219db2c](https://togithub.com/googleapis/java-bigquery/commit/219db2c0023610d2adcba4889a9b785df2113893))
* Update dependency com.google.cloud:google-cloud-shared-dependencies to v3.18.0 ([#2955](https://togithub.com/googleapis/java-bigquery/issues/2955)) ([1ee18eb](https://togithub.com/googleapis/java-bigquery/commit/1ee18ebeb90adeb371ef04cbfc7b18be2c24d1e8))
* Update dependency org.graalvm.buildtools:junit-platform-native to v0.9.28 ([#2956](https://togithub.com/googleapis/java-bigquery/issues/2956)) ([b03effd](https://togithub.com/googleapis/java-bigquery/commit/b03effd3b5f5fd6365de9a6267a1a8ace46d7718))
* Update dependency org.graalvm.buildtools:native-maven-plugin to v0.9.28 ([#2957](https://togithub.com/googleapis/java-bigquery/issues/2957)) ([6465e41](https://togithub.com/googleapis/java-bigquery/commit/6465e413c93e01069f86c80fc424715d46f9067b))
* Update github/codeql-action action to v2.22.2 ([#2944](https://togithub.com/googleapis/java-bigquery/issues/2944)) ([f584e59](https://togithub.com/googleapis/java-bigquery/commit/f584e59571f0c7918d2d83a19b00d49bd5b558c4))
* Update github/codeql-action action to v2.22.3 ([#2954](https://togithub.com/googleapis/java-bigquery/issues/2954)) ([1b2bc18](https://togithub.com/googleapis/java-bigquery/commit/1b2bc18bf49d06e1ccd29745be649108dd28cfa5))
* Update github/codeql-action action to v2.22.4 ([#2958](https://togithub.com/googleapis/java-bigquery/issues/2958)) ([de9bcee](https://togithub.com/googleapis/java-bigquery/commit/de9bcee50ba682ffa93aae063191a8880741507d))
* Update ossf/scorecard-action action to v2.3.1 ([#2960](https://togithub.com/googleapis/java-bigquery/issues/2960)) ([855e698](https://togithub.com/googleapis/java-bigquery/commit/855e69889f68592608c8a56070ffdafdf8365f57))

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/java-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for preview features
2 participants