Skip to content

Commit bd3dde6

Browse files
committed
Revert "chore: generate libraries at Wed Sep 10 03:15:28 UTC 2025"
This reverts commit 5be5ef0.
1 parent 8d50d5d commit bd3dde6

File tree

1 file changed

+83
-0
lines changed
  • google-cloud-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1

1 file changed

+83
-0
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.cloud.bigquery.storage.v1;
17+
18+
import com.google.auto.value.AutoValue;
19+
import javax.annotation.Nullable;
20+
21+
/** Adapter class for data formats used in the AppendRows. */
22+
final class AppendFormats {
23+
/** Enum for the data format used in the AppendRows. */
24+
enum DataFormat {
25+
UNKNOWN,
26+
PROTO,
27+
ARROW
28+
}
29+
30+
/** Container class for the schema used in the AppendRows request. */
31+
@AutoValue
32+
abstract static class AppendRowsSchema {
33+
abstract DataFormat format();
34+
35+
@Nullable
36+
abstract ProtoSchema protoSchema();
37+
38+
@Nullable
39+
abstract ArrowSchema arrowSchema();
40+
41+
static AppendRowsSchema of(ProtoSchema protoSchema) {
42+
return new AutoValue_AppendFormats_AppendRowsSchema(
43+
DataFormat.PROTO, protoSchema, /* arrowSchema= */ null);
44+
}
45+
46+
static AppendRowsSchema of(ArrowSchema arrowSchema) {
47+
return new AutoValue_AppendFormats_AppendRowsSchema(
48+
DataFormat.ARROW, /* protoSchema= */ null, arrowSchema);
49+
}
50+
}
51+
52+
/** Container class for the data used in the AppendRows request. */
53+
@AutoValue
54+
abstract static class AppendRowsData {
55+
abstract DataFormat format();
56+
57+
@Nullable
58+
abstract ProtoRows protoRows();
59+
60+
@Nullable
61+
abstract ArrowRecordBatch arrowRecordBatch();
62+
63+
// Row count for arrowRecordBatch. It is defaulted to -1 of not set.
64+
abstract long recordBatchRowCount();
65+
66+
static AppendRowsData of(ProtoRows protoRows) {
67+
return new AutoValue_AppendFormats_AppendRowsData(
68+
DataFormat.PROTO, protoRows, /* arrowRecordBatch= */ null, /* recordBatchRowCount= */ -1);
69+
}
70+
71+
static AppendRowsData of(ArrowRecordBatch arrowRecordBatch) {
72+
return new AutoValue_AppendFormats_AppendRowsData(
73+
DataFormat.ARROW, /* protoRows= */ null, arrowRecordBatch, /* recordBatchRowCount= */ -1);
74+
}
75+
76+
static AppendRowsData of(ArrowRecordBatch arrowRecordBatch, long recordBatchRowCount) {
77+
return new AutoValue_AppendFormats_AppendRowsData(
78+
DataFormat.ARROW, /* protoRows= */ null, arrowRecordBatch, recordBatchRowCount);
79+
}
80+
}
81+
82+
private AppendFormats() {}
83+
}

0 commit comments

Comments
 (0)