Skip to content

feat(bigquery): Add support for custom timezones and timestamps #3859

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

Merged
merged 6 commits into from
Jun 30, 2025

Conversation

whuffman36
Copy link
Contributor

@whuffman36 whuffman36 commented Jun 23, 2025

This PR adds support for custom timezones, timestamps, datetimes, null markers, and CSV column matching in both the external tables and load job configurations.

Internal issue: b/374142084

@product-auto-label product-auto-label bot added size: l Pull request size is large. api: bigquery Issues related to the googleapis/java-bigquery API. labels Jun 23, 2025
@whuffman36 whuffman36 self-assigned this Jun 23, 2025
@whuffman36 whuffman36 marked this pull request as ready for review June 23, 2025 21:49
@whuffman36 whuffman36 requested review from a team as code owners June 23, 2025 21:49
Copy link
Contributor

@PhongChuong PhongChuong left a comment

Choose a reason for hiding this comment

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

Overall looks good.
Just some minor comments.

* reads the header row as column names and reorders columns to match the field names in the
* schema.
*/
public abstract Builder setSourceColumnMatch(String sourceColumnMatch);
Copy link
Contributor

Choose a reason for hiding this comment

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

As discussed offline, it's probably useful to have a string enum for: [SOURCE_COLUMN_MATCH_UNSPECIFIED, POSITION, NAME]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the code to use enums instead, though oddly enough only the JobConfiguration proto has the UNSPECIFIED option - the external table only defines POSITION andNAME. I made two separate enums for the configuration and external table. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's okay to have 2 separate enums but it does feel weird that the two values are not interchangeable.
@shollyman , do you know if UNSPECIFIED is supposed to be available for external_table also?

@@ -57,6 +57,22 @@ public ExternalDataConfiguration apply(ExternalTableDefinition tableInfo) {

private static final long serialVersionUID = -5951580238459622025L;

public enum SourceColumnMatch {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

* reads the header row as column names and reorders columns to match the field names in the
* schema.
*/
public abstract Builder setSourceColumnMatch(String sourceColumnMatch);
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's okay to have 2 separate enums but it does feel weird that the two values are not interchangeable.
@shollyman , do you know if UNSPECIFIED is supposed to be available for external_table also?

shollyman
shollyman previously approved these changes Jun 27, 2025
Copy link
Contributor

@shollyman shollyman left a comment

Choose a reason for hiding this comment

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

Generally looks good, modulo Phong's suggestion about string enums vs enums.

@@ -57,6 +57,22 @@ public ExternalDataConfiguration apply(ExternalTableDefinition tableInfo) {

private static final long serialVersionUID = -5951580238459622025L;

public enum SourceColumnMatch {
Copy link
Contributor

Choose a reason for hiding this comment

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

+1

@whuffman36 whuffman36 added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2025
@yoshi-kokoro yoshi-kokoro removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jun 30, 2025
@whuffman36 whuffman36 requested a review from mrfaizal June 30, 2025 22:49
@whuffman36 whuffman36 merged commit e5467c9 into main Jun 30, 2025
22 of 23 checks passed
@whuffman36 whuffman36 deleted the timezone branch June 30, 2025 23:27
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: l Pull request size is large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants