Skip to content

Commit afb222f

Browse files
authored
chore(bqjdbc): update test client with customized connection string (googleapis#13162)
1 parent ddfc837 commit afb222f

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

java-bigquery/google-cloud-bigquery-jdbc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ target-it/**
55
**/BigQueryStatementE2EBenchmark.java
66

77
tools/**/*.class
8+
tools/**/drivers/**
9+
tools/**/logs/**
810
tools/**/*.jfr

java-bigquery/google-cloud-bigquery-jdbc/tools/client/Makefile

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ DRIVER_CLASS = com.google.cloud.bigquery.jdbc.BigQueryDriver
2121
URL ?= jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;
2222
CREDENTIALS ?= $(GOOGLE_APPLICATION_CREDENTIALS)
2323

24+
# Default connection parameters
25+
PARAMS = ProjectId=bigquery-devtools-drivers;OAuthType=0;OAuthServiceAcctEmail=;OAuthPvtKeyPath=$(CREDENTIALS);
26+
27+
# Additional connection parameters
28+
EXTRA_PARAMS ?=
29+
2430
ROWS ?= 10
2531
COLS ?= 5
2632
METHOD ?= getTables
@@ -42,18 +48,9 @@ else
4248
JFR_FLAGS =
4349
endif
4450

45-
COMMON_FLAGS = --url "$(URL)" \
51+
COMMON_FLAGS = --url "$(URL);$(DEFAULT_PARAMS);$(PARAMS);$(EXTRA_PARAMS)" \
4652
--driver-jar "$(DRIVER_JAR)" \
47-
--driver-class "$(DRIVER_CLASS)" \
48-
--ProjectId "bigquery-devtools-drivers" \
49-
--OAuthType=0 \
50-
--OAuthServiceAcctEmail="" \
51-
--OAuthPvtKeyPath="$(CREDENTIALS)" \
52-
--EnableHighThroughputAPI=1 \
53-
--HighThroughputActivationRatio=0 \
54-
--HighThroughputMinTableSize=0 \
55-
--MaxResults=20000 \
56-
--EnableSession=1
53+
--driver-class "$(DRIVER_CLASS)"
5754

5855
query: classes
5956
$(J) $(JFR_FLAGS) -cp .:$(DRIVER_JAR) JDBCClient --action query $(COMMON_FLAGS) --query "$(QUERY)" $(OUTPUT_FLAG) $(EXTRA_ARGS)

java-bigquery/google-cloud-bigquery-jdbc/tools/client/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The Makefile provides convenient targets to run the client. You can override def
1919
Common variables:
2020
- `URL`: JDBC connection URL (defaults to public BigQuery endpoint)
2121
- `CREDENTIALS`: Path to service account JSON key (defaults to `$GOOGLE_APPLICATION_CREDENTIALS`)
22+
- `PARAMS`: Default set of connection string params.
23+
- `EXTRA_PARAMS`: Additional connection string parameters (e.g., `EXTRA_PARAMS="Timeout=30;LogLevel=6;"`)
2224
- `OUTPUT`: Set to `false` to suppress query result output (defaults to `true`)
2325
- `EXTRA_ARGS`: Extra arguments to pass to the client (e.g., `EXTRA_ARGS="--table my_table"`)
2426

0 commit comments

Comments
 (0)