KEMBAR78
feat(bigquery): Add support for custom timezones and timestamps by whuffman36 · Pull Request #3859 · googleapis/java-bigquery · GitHub
Skip to content

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?


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.


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
lqiu96 pushed a commit that referenced this pull request Jul 16, 2025
* feat(bigquery): Add support for custom timezones and timestamps

* update ignored-diff

* fix data -> date typo

* Add enums for SourceColumnMatch

* Change null markers test names

* change enums to StringEnumValue
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