FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat(write): Support Arrow format for Write API by AlexZMLyu · Pull Request #3086 · googleapis/java-bigquerystorage · GitHub

This repository was archived by the owner on Feb 24, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .java  (9) .xml  (2) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
49 changes: 31 additions & 18 deletions google-cloud-bigquerystorage/pom.xml
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
Expand Up @@ -16,6 +16,20 @@
<properties>
<site.installationModule>google-cloud-bigquerystorage</site.installationModule>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
<version>17.0.0</version>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
<version>17.0.0</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<extensions>
<extension>
Expand Down Expand Up @@ -63,10 +77,6 @@
<groupId>io.grpc</groupId>
<artifactId>grpc-util</artifactId>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-util</artifactId>
</dependency>
<dependency>
<groupId>com.google.api</groupId>
<artifactId>api-common</artifactId>
Expand Down Expand Up @@ -148,11 +158,11 @@
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>com.google.auth</groupId>
<artifactId>google-auth-library-credentials</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
Expand All @@ -161,6 +171,10 @@
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
</dependency>

<!-- Test dependencies -->
<dependency>
Expand Down Expand Up @@ -195,10 +209,10 @@
<version>1.4.4</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
<exclusion>
<groupId>org.checkerframework</groupId>
<artifactId>checker-qual</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand All @@ -213,11 +227,6 @@
<version>1.11.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-vector</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.arrow</groupId>
<artifactId>arrow-memory-core</artifactId>
Expand All @@ -243,6 +252,10 @@
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
</dependency>
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</dependency>
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-core</artifactId>
Expand Down
Comment thread
AlexZMLyu marked this conversation as resolved.
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,83 @@
/*
* 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
*
* 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.storage.v1;

import com.google.auto.value.AutoValue;
import javax.annotation.Nullable;

/** Adapter class for data formats used in the AppendRows. */
final class AppendFormats {
/** Enum for the data format used in the AppendRows. */
enum DataFormat {
UNKNOWN,
PROTO,
ARROW
}

/** Container class for the schema used in the AppendRows request. */
@AutoValue
abstract static class AppendRowsSchema {
abstract DataFormat format();

@Nullable
abstract ProtoSchema protoSchema();

@Nullable
abstract ArrowSchema arrowSchema();

static AppendRowsSchema of(ProtoSchema protoSchema) {
return new AutoValue_AppendFormats_AppendRowsSchema(
DataFormat.PROTO, protoSchema, /* arrowSchema= */ null);
}

static AppendRowsSchema of(ArrowSchema arrowSchema) {
return new AutoValue_AppendFormats_AppendRowsSchema(
DataFormat.ARROW, /* protoSchema= */ null, arrowSchema);
}
}

/** Container class for the data used in the AppendRows request. */
@AutoValue
abstract static class AppendRowsData {
abstract DataFormat format();

@Nullable
abstract ProtoRows protoRows();

@Nullable
abstract ArrowRecordBatch arrowRecordBatch();

// Row count for arrowRecordBatch. It is defaulted to -1 of not set.
abstract long recordBatchRowCount();

static AppendRowsData of(ProtoRows protoRows) {
return new AutoValue_AppendFormats_AppendRowsData(
DataFormat.PROTO, protoRows, /* arrowRecordBatch= */ null, /* recordBatchRowCount= */ -1);
}

static AppendRowsData of(ArrowRecordBatch arrowRecordBatch) {
return new AutoValue_AppendFormats_AppendRowsData(
DataFormat.ARROW, /* protoRows= */ null, arrowRecordBatch, /* recordBatchRowCount= */ -1);
}

static AppendRowsData of(ArrowRecordBatch arrowRecordBatch, long recordBatchRowCount) {
return new AutoValue_AppendFormats_AppendRowsData(
DataFormat.ARROW, /* protoRows= */ null, arrowRecordBatch, recordBatchRowCount);
}
}

private AppendFormats() {}
}
Loading
Loading

Back | FazBrowse Home | New Git URL