Skip to content

feat(bigquery-jdbc): record errors and flush on batchSizeThreshold - #14443

Open
Neenu1995 wants to merge 5 commits into
jdbc-telemetry-featurefrom
jdbc-telemetry-pr14
Open

Neenu1995 wants to merge 5 commits into
jdbc-telemetry-featurefrom
jdbc-telemetry-pr14

Conversation

@Neenu1995

@Neenu1995 Neenu1995 commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Driver environment

  • Wire DriverEnvironmentDetector.build() into the telemetry config .
  • Rename DriverEnvironmentBuilder -> DriverEnvironmentDetector; report
    DRIVER_NAME as Google-BigQuery-JDBC-Driver.
  • Fall back to a random UUID on any RuntimeException while persisting the
    telemetry tag, not just SecurityException.

SQLState emission

  • Add BigQueryJdbcSqlStates (11 SQL:2003 constants) and
    BigQueryJdbcExceptionUtils.sqlStateForCause(), mapping BigQuery reason
    values onto standard states with an HY000 default.
  • All BigQueryJdbcException constructors now set a SQLState; the
    InterruptedException overload reports 57014.
  • BigQueryConversionException -> 22000, feature-not-supported -> 0A000,
    syntax error -> 42000.
  • Fix BigQueryJdbcSqlSyntaxErrorException(BigQueryException), which passed
    "Incorrect SQL syntax." into the SQLState parameter and dropped the cause.
  • Delete unused BigQueryJdbcCoercionException and
    BigQueryJdbcCoercionNotFoundException.

Error metrics

  • Add TelemetryManager.extractXdbcCode(): first numeric SQLState in the cause
    chain, 0 when none.
  • Record errors in BigQueryJdbcContextProxy at the InvocationTargetException
    boundary, before throw cause, leaving the exception unchanged.

Batching

  • Flush on queue size at batchSizeThreshold, dispatched to the batcher thread
    so no caller thread does network I/O.
  • Derive the unique-profile cap as 2 x batchSizeThreshold (fallback 3000),
    preserving threshold < cap.
  • Suppress the size trigger while flushes are failing; reschedule() continues
    to space retries.

@Neenu1995
Neenu1995 requested review from a team as code owners September 19, 2026 01:13
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Warning

Gemini encountered an error creating the review. You can try again by commenting /gemini review.

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.

1 participant