Skip to content

feat(bigquery-jdbc): add EnableTimestampPicos connection property and its plumbing - #14284

Open
keshavdandeva wants to merge 3 commits into
mainfrom
jdbc-picosecond-support
Open

feat(bigquery-jdbc): add EnableTimestampPicos connection property and its plumbing#14284
keshavdandeva wants to merge 3 commits into
mainfrom
jdbc-picosecond-support

Conversation

@keshavdandeva

@keshavdandeva keshavdandeva commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

b/544843125

This PR introduces the EnableTimestampPicos connection property to configure 12-digit picosecond precision for BigQuery TIMESTAMP(12) data, establishing the configuration foundation across the driver pipeline.

Key Changes

  • Configuration & URL Plumbing:
    • Defined ENABLE_TIMESTAMP_PICOS_PROPERTY_NAME = "EnableTimestampPicos" (default: false) in BigQueryJdbcUrlUtility.java
    • Added standard getters/setters in DataSource.java and registered the setter in PROPERTY_SETTERS via convertIntToBoolean (supporting 1, 0, true, false)
    • Propagated the flag through BigQueryConnection.java (registered in SAFE_TO_LOG_PROPERTIES) and into immutable BigQuerySettings.java
  • Documentation:
    • Documented the configuration property and precision behavior in docs/USER_GUIDE.md

Testing

  • BigQueryJdbcUrlUtilityTest.java: Verified parsing of EnableTimestampPicos (1 and 0).
  • BigQueryConnectionTest.java: Verified default (false) and URL-configured (true) states.

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a new connection property, EnableTimestampPicos, to support 12-digit picosecond precision for TIMESTAMP(12) data types in the BigQuery JDBC driver. The feedback highlights a critical issue in BigQueryStatement.java where catching any BigQueryException when EnableTimestampPicos is enabled and Legacy SQL is used will mask all other unrelated errors (such as syntax errors or permission issues). It is recommended to inspect the exception details to ensure the error is actually related to timestamp precision before throwing the compatibility exception.

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

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.

Code Review

This pull request introduces a new connection property, EnableTimestampPicos, to enable 12-digit picosecond precision for TIMESTAMP(12) data types in the BigQuery JDBC driver. The changes span documentation, configuration utilities, connection settings, and statements, along with corresponding unit tests. Feedback on the changes includes a request to implement the missing error translation logic and tests for Legacy SQL backend failures as described in the PR description, and a suggestion to use Boolean.TRUE.equals() when retrieving the property from the data source to prevent a potential NullPointerException from automatic unboxing.

@keshavdandeva
keshavdandeva marked this pull request as ready for review September 7, 2026 15:29
@keshavdandeva
keshavdandeva requested review from a team as code owners September 7, 2026 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants