Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a68a6b3
fix(bigquery-jdbc): add single-pass URL parser, remove PARSE_CACHE, a…
Neenu1995 Nov 30, 2026
a84ef0a
fix(bigquery-jdbc): pass typed DataSource overrides and unify last-wi…
Neenu1995 Nov 30, 2026
2033143
fix(bigquery-jdbc): redact DatabaseMetaData.getURL and getPropertyInf…
Neenu1995 Nov 30, 2026
6aa7c4f
fix(bigquery-jdbc): use Locale.ROOT for property lookup and harden UR…
Neenu1995 Nov 30, 2026
c76c6f2
Merge branch 'fix/g01-url-parsing-and-sanitization' into fix/g01-stru…
Neenu1995 Nov 30, 2026
8b4f633
fix(bigquery-jdbc): snapshot caller Properties and ensure telemetry o…
Neenu1995 Nov 30, 2026
7cd6b1c
Merge branch 'fix/g01-structured-connect-and-datasource-overrides' in…
Neenu1995 Nov 30, 2026
6abbc34
fix(bigquery-jdbc): wrap getPropertyInfo parse errors in SQLException…
Neenu1995 Nov 30, 2026
fce23c8
fix(bigquery-jdbc): warn when customOpenTelemetry property is non-emp…
Neenu1995 Nov 30, 2026
2226845
Merge branch 'fix/g01-structured-connect-and-datasource-overrides' in…
Neenu1995 Nov 30, 2026
069d0dc
fix(bigquery-jdbc): return endpoint-only display URL and ignore inval…
Neenu1995 Dec 2, 2026
278aecb
Merge branch 'fix/g01-url-parsing-and-sanitization' into fix/g01-stru…
Neenu1995 Dec 2, 2026
0618a55
fix(bigquery-jdbc): treat endpoint override aliases as one property a…
Neenu1995 Dec 2, 2026
2175da1
Merge branch 'fix/g01-structured-connect-and-datasource-overrides' in…
Neenu1995 Dec 2, 2026
83e5378
fix(bigquery-jdbc): align getPropertyInfo telemetry opt-out and alias…
Neenu1995 Dec 2, 2026
bbaaf1b
fix(bigquery-jdbc): copy an empty endpoint override alias as unset
Neenu1995 Dec 2, 2026
9d45c98
Merge branch 'fix/g01-structured-connect-and-datasource-overrides' in…
Neenu1995 Dec 2, 2026
c5ec3d3
fix(bigquery-jdbc): update getURL comments and drop inert alias call …
Neenu1995 Dec 2, 2026
119d174
refactor(bigquery-jdbc): drop redundant empty-prefix branch in toSani…
Neenu1995 Dec 3, 2026
76b5090
docs(bigquery-jdbc): describe single-pass URL parsing without PARSE_C…
Neenu1995 Dec 3, 2026
e5d9f1d
Merge branch 'fix/g01-url-parsing-and-sanitization' into fix/g01-stru…
Neenu1995 Dec 3, 2026
a8bfdfb
Merge branch 'fix/g01-structured-connect-and-datasource-overrides' in…
Neenu1995 Dec 3, 2026
bb8dc43
docs(bigquery-jdbc): clarify getPropertyInfo redaction and empty valu…
Neenu1995 Dec 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion java-bigquery-jdbc/DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ graph TD

- **`BigQueryDriver`**: JDBC entry point registered with `java.sql.DriverManager`. Intercepts `jdbc:bigquery://` URLs, initializes early logger state, and instantiates `BigQueryConnection`.
- **`BigQueryConnection`**: Represents an active BigQuery session, holding dataset defaults, connection configuration maps, and transaction/session state (`EnableSession=true`, `session_id`).
- **`BigQueryJdbcUrlUtility`**: Parses and validates connection string parameters using a bounded LRU parse cache (`PARSE_CACHE`) to avoid heavy allocations during frequent connection creation.
- **`BigQueryJdbcUrlUtility`**: Parses and validates connection string parameters in a single pass (`parseConnectionUrl`). It keeps no static cache, so URLs that carry credentials are not retained across connections.
- **`BigQueryJdbcContextProxy`**: A dynamic proxy layer (`java.lang.reflect.Proxy`) wrapping JDBC statements, connections, and metadata. Intercepts calls to propagate ThreadLocal MDC parameters (`connectionId`) across execution threads and enforce state validation (`checkClosed()`).
- **`BigQueryTypeRegistry` & `TypeDescriptor`**: Centralized, bidirectional mapping between JDBC SQL types, Java classes and BigQuery types (`StandardSQLTypeName`), including the coercion of raw values (`Date`, `Timestamp`, `BigDecimal`, etc.) into the expected Java type.
- **`BigQueryArrowResultSet`**: Custom result set implementation accelerating large query result retrieval via the BigQuery Storage Read API gRPC stream.
Expand Down
15 changes: 15 additions & 0 deletions java-bigquery-jdbc/docs/USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,21 @@ String url = "jdbc:bigquery://https://bigquery.googleapis.com:443"
| `gcpTelemetryCredentials` | `null` | File path or raw JSON credentials string for OpenTelemetry GCP exporters. |
| `useGlobalOpenTelemetry` | `false` | Instructs the driver to register with the global OpenTelemetry instance (`GlobalOpenTelemetry`) in the JVM environment. |

### Configuration precedence and credential handling

- When a property is set in more than one place, `DataSource` setters win over
`Properties`, which win over the JDBC URL. An explicit
`EnableDiagnosticTelemetry` opt-out (`0` or `false`) in any source always wins.
- `DatabaseMetaData.getURL()` returns only the connection endpoint, without any
connection properties, so it cannot be used to open a second connection.
- `Driver.getPropertyInfo()` returns `null` as the value of credentials and of any
other property that is not on the driver's safe-to-log list.
- `Labels` and `QueryProperties` reject duplicate or empty keys.
- `Properties` keys that contain `;`, `=`, control characters, or leading or
trailing spaces are ignored with a warning.
- Empty values (`""`), whether from `Properties` or `DataSource` setters, are
treated as unset.

---

## 5. Data Type Mapping Reference
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public class BigQueryConnection extends BigQueryNoOpsConnection {
BigQueryJdbcUrlUtility.ENABLE_PROJECT_DISCOVERY_PROPERTY_NAME,
BigQueryJdbcUrlUtility.REQUEST_GOOGLE_DRIVE_SCOPE_PROPERTY_NAME,
BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROPERTY_NAME,
BigQueryJdbcUrlUtility.SSL_TRUST_STORE_TYPE_PROPERTY_NAME,
BigQueryJdbcUrlUtility.SSL_TRUST_STORE_PROVIDER_PROPERTY_NAME,
BigQueryJdbcUrlUtility.MAX_BYTES_BILLED_PROPERTY_NAME,
BigQueryJdbcUrlUtility.LABELS_PROPERTY_NAME,
BigQueryJdbcUrlUtility.REQUEST_REASON_PROPERTY_NAME,
Expand All @@ -171,6 +173,10 @@ public class BigQueryConnection extends BigQueryNoOpsConnection {
BigQueryJdbcUrlUtility.OAUTH_SA_EMAIL_PROPERTY_NAME,
BigQueryJdbcUrlUtility.OAUTH_PVT_KEY_PATH_PROPERTY_NAME,
BigQueryJdbcUrlUtility.OAUTH_CLIENT_ID_PROPERTY_NAME,
BigQueryJdbcUrlUtility.GCP_TELEMETRY_PROJECT_ID_PROPERTY_NAME,
BigQueryJdbcUrlUtility.ENABLE_GCP_TRACE_EXPORTER_PROPERTY_NAME,
BigQueryJdbcUrlUtility.ENABLE_GCP_LOG_EXPORTER_PROPERTY_NAME,
BigQueryJdbcUrlUtility.USE_GLOBAL_OTEL_PROPERTY_NAME,
BigQueryJdbcUrlUtility.ENABLE_DIAGNOSTIC_TELEMETRY_PROPERTY_NAME,
BigQueryJdbcUrlUtility.ENABLE_GRAPH_METADATA_PROPERTY_NAME)
.build();
Expand Down Expand Up @@ -297,11 +303,19 @@ static String sanitizeForLog(String value) {
return sb == null ? value : sb.toString();
}

/**
* Returns whether {@code propertyName} is in the fail-closed {@link #SAFE_TO_LOG_PROPERTIES}
* allowlist. Any unknown or sensitive property returns {@code false}.
*/
static boolean isSafeToLogProperty(String propertyName) {
return propertyName != null && SAFE_TO_LOG_PROPERTIES.contains(propertyName);
}

static String maskPropertyValue(String key, Object value) {
if (value == null) {
return null;
}
if (key == null || !SAFE_TO_LOG_PROPERTIES.contains(key)) {
if (!isSafeToLogProperty(key)) {
return "*****";
}
return sanitizeForLog(String.valueOf(value));
Expand Down Expand Up @@ -332,15 +346,11 @@ static String maskPropertyValue(String key, Object value) {
ExecutorService createdQueryExecutor = null;
ExecutorService createdMetadataExecutor = null;
try (BigQueryJdbcMdc.MdcCloseable mdc = BigQueryJdbcMdc.registerInstance(this.connectionId)) {
this.connectionUrl = url;
// DatabaseMetaData.getURL() exposes only the connection endpoint, never connection
// properties, whether the connection came from Driver, DataSource, or the constructor.
this.connectionUrl = BigQueryJdbcUrlUtility.sanitizeUrlForDisplay(url);
if (LOG.isLoggable(Level.CONFIG)) {
Properties connectionProps = ds.createProperties();
Properties maskedProps = new Properties();
for (String name : connectionProps.stringPropertyNames()) {
maskedProps.setProperty(
sanitizeForLog(name), maskPropertyValue(name, connectionProps.getProperty(name)));
}
LOG.config("Connection properties: %s", maskedProps.toString());
LOG.config("Connection properties: %s", ds.toMaskedLogMap().toString());
}
this.openStatements = ConcurrentHashMap.newKeySet();
this.autoCommit = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public boolean allTablesAreSelectable() {

@Override
public String getURL() {
// Returns only the sanitized jdbc:bigquery: connection endpoint (no connection properties).
return this.URL;
}

Expand Down
Loading
Loading