Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 0 deletions java-bigquery/google-cloud-bigquery-jdbc/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ target-it/**
**/ITBigQueryJDBCLocalTest.java

tools/**/*.class
tools/**/drivers/**
tools/**/logs/**
tools/**/*.jfr
19 changes: 8 additions & 11 deletions java-bigquery/google-cloud-bigquery-jdbc/tools/client/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ DRIVER_CLASS = com.google.cloud.bigquery.jdbc.BigQueryDriver
URL ?= jdbc:bigquery://https://www.googleapis.com/bigquery/v2:443;
CREDENTIALS ?= $(GOOGLE_APPLICATION_CREDENTIALS)

# Default connection parameters
PARAMS = ProjectId=bigquery-devtools-drivers;OAuthType=0;OAuthServiceAcctEmail=;OAuthPvtKeyPath=$(CREDENTIALS);
Comment thread
logachev marked this conversation as resolved.

# Additional connection parameters
EXTRA_PARAMS ?=

ROWS ?= 10
COLS ?= 5
METHOD ?= getTables
Expand All @@ -42,18 +48,9 @@ else
JFR_FLAGS =
endif

COMMON_FLAGS = --url "$(URL)" \
COMMON_FLAGS = --url "$(URL);$(DEFAULT_PARAMS);$(PARAMS);$(EXTRA_PARAMS)" \
--driver-jar "$(DRIVER_JAR)" \
--driver-class "$(DRIVER_CLASS)" \
--ProjectId "bigquery-devtools-drivers" \
--OAuthType=0 \
--OAuthServiceAcctEmail="" \
--OAuthPvtKeyPath="$(CREDENTIALS)" \
--EnableHighThroughputAPI=1 \
--HighThroughputActivationRatio=0 \
--HighThroughputMinTableSize=0 \
--MaxResults=20000 \
--EnableSession=1
--driver-class "$(DRIVER_CLASS)"

query: classes
$(J) $(JFR_FLAGS) -cp .:$(DRIVER_JAR) JDBCClient --action query $(COMMON_FLAGS) --query "$(QUERY)" $(OUTPUT_FLAG) $(EXTRA_ARGS)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The Makefile provides convenient targets to run the client. You can override def
Common variables:
- `URL`: JDBC connection URL (defaults to public BigQuery endpoint)
- `CREDENTIALS`: Path to service account JSON key (defaults to `$GOOGLE_APPLICATION_CREDENTIALS`)
- `PARAMS`: Default set of connection string params.
- `EXTRA_PARAMS`: Additional connection string parameters (e.g., `EXTRA_PARAMS="Timeout=30;LogLevel=6;"`)
- `OUTPUT`: Set to `false` to suppress query result output (defaults to `true`)
- `EXTRA_ARGS`: Extra arguments to pass to the client (e.g., `EXTRA_ARGS="--table my_table"`)

Expand Down
Loading