This repository was archived by the owner on Mar 23, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 134
chore: move Google JDBC driver code #4050
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,329 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <!-- | ||
| Copyright 2025 Google LLC | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| --> | ||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
| <modelVersion>4.0.0</modelVersion> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-bigquery-jdbc</artifactId> | ||
| <version>0.1.0</version> | ||
| <packaging>jar</packaging> | ||
| <name>BigQuery JDBC</name> | ||
| <url>https://github.com/googleapis/java-bigquery-jdbc</url> | ||
| <description>JDBC for BigQuery</description> | ||
|
|
||
| <properties> | ||
| <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
| <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> | ||
| <github.global.server>github</github.global.server> | ||
| <site.installationModule>google-cloud-bigquery-jdbc | ||
| </site.installationModule> | ||
| </properties> | ||
|
|
||
| <build> | ||
| <resources> | ||
| <resource> | ||
| <directory>src/main/resources</directory> | ||
| <filtering>true</filtering> | ||
| </resource> | ||
| </resources> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <version>3.5.2</version> | ||
| <configuration> | ||
| <skip>${skipSurefire}</skip> | ||
| </configuration> | ||
| </plugin> | ||
| <plugin> | ||
| <groupId>org.jacoco</groupId> | ||
| <artifactId>jacoco-maven-plugin</artifactId> | ||
| <version>0.8.13</version> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
|
|
||
| <parent> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-bigquery-jdbc-parent</artifactId> | ||
| <version>0.1.0</version> | ||
| </parent> | ||
| <dependencies> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-bigquery</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-bigquerystorage</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>api-common</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-vector</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.guava</groupId> | ||
| <artifactId>guava</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-core</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>gax</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.auth</groupId> | ||
| <artifactId>google-auth-library-oauth2-http</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.auth</groupId> | ||
| <artifactId>google-auth-library-credentials</artifactId> | ||
| </dependency> | ||
|
|
||
| <!-- Dependencies for Arrow RS --> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-memory-core</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.arrow</groupId> | ||
| <artifactId>arrow-memory-netty</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.protobuf</groupId> | ||
| <artifactId>protobuf-java</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.api.grpc</groupId> | ||
| <artifactId>proto-google-cloud-bigquerystorage-v1</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.code.gson</groupId> | ||
| <artifactId>gson</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.code.findbugs</groupId> | ||
| <artifactId>jsr305</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.httpcomponents.core5</groupId> | ||
| <artifactId>httpcore5</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.apache.httpcomponents.client5</groupId> | ||
| <artifactId>httpclient5</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.http-client</groupId> | ||
| <artifactId>google-http-client</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.http-client</groupId> | ||
| <artifactId>google-http-client-apache-v5</artifactId> | ||
| <exclusions> <!-- Exclusions are here for removing EOL vulnerability --> | ||
| <exclusion> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpcore</artifactId> | ||
| </exclusion> | ||
| <exclusion> | ||
| <groupId>org.apache.httpcomponents</groupId> | ||
| <artifactId>httpclient</artifactId> | ||
| </exclusion> | ||
| </exclusions> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.cloud</groupId> | ||
| <artifactId>google-cloud-core-http</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>com.google.api</groupId> | ||
| <artifactId>gax-grpc</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-api</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-netty-shaded</artifactId> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>io.grpc</groupId> | ||
| <artifactId>grpc-core</artifactId> | ||
| </dependency> | ||
| <!-- Test Dependencies --> | ||
| <dependency> | ||
| <groupId>com.google.truth</groupId> | ||
| <artifactId>truth</artifactId> | ||
| <version>1.1.3</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>junit</groupId> | ||
| <artifactId>junit</artifactId> | ||
| <version>4.13.2</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
| <dependency> | ||
| <groupId>org.mockito</groupId> | ||
| <artifactId>mockito-core</artifactId> | ||
| <version>4.11.0</version> | ||
| <scope>test</scope> | ||
| </dependency> | ||
|
Comment on lines
+177
to
+193
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Several test dependency versions are hardcoded. To ensure consistency across the project and simplify updates, it's recommended to manage these versions in the parent |
||
| </dependencies> | ||
|
|
||
| <profiles> | ||
| <profile> | ||
| <id>java17</id> | ||
| <activation> | ||
| <jdk>[17,)</jdk> | ||
| <property> | ||
| <!-- | ||
| In Java 8 unit tests where we run tests in Java 8 after building | ||
| bytecode on Java 17, we don't want to add the argLine | ||
| --> | ||
| <name>!jvm</name> | ||
| </property> | ||
| </activation> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-surefire-plugin</artifactId> | ||
| <configuration> | ||
| <argLine>--add-opens=java.base/java.nio=org.apache.arrow.memory.core,ALL-UNNAMED</argLine> | ||
| </configuration> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
|
|
||
| <!-- Profile used to build JAR with all dependencies for the release. --> | ||
| <profile> | ||
| <id>release-all-dependencies-shaded</id> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <version>3.5.2</version> <!-- Use the latest version --> | ||
| <executions> | ||
| <execution> | ||
| <configuration> | ||
| <relocations> | ||
| <relocation> | ||
| <pattern>com</pattern> | ||
| <shadedPattern>shaded.bqjdbc.com</shadedPattern> | ||
| <excludes> | ||
| <exclude>com.google.cloud.bigquery.jdbc.*</exclude> | ||
| </excludes> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>org</pattern> | ||
| <shadedPattern>shaded.bqjdbc.org</shadedPattern> | ||
| <excludes> | ||
| <exclude>org.conscrypt.*</exclude> | ||
| </excludes> | ||
| </relocation> | ||
| <relocation> | ||
| <pattern>io</pattern> | ||
| <shadedPattern>shaded.bqjdbc.io</shadedPattern> | ||
| </relocation> | ||
| </relocations> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
|
|
||
| <profile> | ||
| <id>release-all-dependencies</id> | ||
| <build> | ||
| <plugins> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-shade-plugin</artifactId> | ||
| <version>3.5.2</version> <!-- Use the latest version --> | ||
| <executions> | ||
| <execution> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>shade</goal> | ||
| </goals> | ||
| <configuration> | ||
| <createDependencyReducedPom>false</createDependencyReducedPom> | ||
| <archive> | ||
| <manifestEntries> | ||
| <Add-Opens>java.base/java.nio=ALL-UNNAMED</Add-Opens> | ||
| </manifestEntries> | ||
| </archive> | ||
| <transformers> | ||
| <transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> | ||
| <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"/> | ||
| <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> | ||
| <resource>META-INF/io.netty.versions.properties</resource> | ||
| </transformer> | ||
| </transformers> | ||
| <filters> | ||
| <filter> | ||
| <artifact>*:*</artifact> | ||
| <excludes> | ||
| <exclude>META-INF/LICENSE*</exclude> | ||
| <exclude>META-INF/NOTICE*</exclude> | ||
| <exclude>META-INF/DEPENDENCIES</exclude> | ||
| <exclude>META-INF/proguard/*.pro</exclude> | ||
| <exclude>META-INF/maven/**</exclude> | ||
| <exclude>META-INF/*.MF</exclude> | ||
| <exclude>META-INF/*.SF</exclude> | ||
| <exclude>META-INF/*.DSA</exclude> | ||
| <exclude>META-INF/*.RSA</exclude> | ||
| <exclude>arrow-git.properties</exclude> | ||
| </excludes> | ||
| </filter> | ||
| </filters> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> | ||
| </plugins> | ||
| </build> | ||
| </profile> | ||
|
|
||
| <!-- Profile used inside docker --> | ||
| <profile> | ||
| <id>docker</id> | ||
| <activation> | ||
| <property> | ||
| <name>env.JDBC_DOCKER_ENV</name> | ||
| </property> | ||
| </activation> | ||
| <build> | ||
| <!-- Ensure it doesn't conflict with local build directories --> | ||
| <directory>/mvn/test-target</directory> | ||
| </build> | ||
| </profile> | ||
| </profiles> | ||
| </project> | ||
29 changes: 29 additions & 0 deletions
29
...y-jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryConversionException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| /* | ||
| * Copyright 2025 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.google.cloud.bigquery.exception; | ||
|
|
||
| import java.sql.SQLException; | ||
|
|
||
| /** | ||
| * Exception for errors that occur when the driver cannot convert a value from one type to another. | ||
| */ | ||
| public class BigQueryConversionException extends SQLException { | ||
|
|
||
| public BigQueryConversionException(String message, Throwable cause) { | ||
| super(message, cause); | ||
| } | ||
| } |
36 changes: 36 additions & 0 deletions
36
...jdbc/src/main/java/com/google/cloud/bigquery/exception/BigQueryJdbcCoercionException.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| /* | ||
| * Copyright 2023 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * https://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| package com.google.cloud.bigquery.exception; | ||
|
|
||
| import com.google.api.core.InternalApi; | ||
|
|
||
| /** | ||
| * Thrown to indicate that the coercion was attempted but couldn't be performed successfully because | ||
| * of some error. | ||
| */ | ||
| @InternalApi | ||
| public class BigQueryJdbcCoercionException extends RuntimeException { | ||
|
|
||
| /** | ||
| * Construct a new exception with the specified cause. | ||
| * | ||
| * @param cause the actual cause which was thrown while performing the coercion. | ||
| */ | ||
| public BigQueryJdbcCoercionException(Exception cause) { | ||
| super("Coercion error", cause); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are arrow deps from BQstorage or is arrow used natively inside jdbc?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BQStorage dependency