[
https://issues.apache.org/jira/browse/BEAM-8933?focusedWorklogId=592484&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-592484
]
ASF GitHub Bot logged work on BEAM-8933:
----------------------------------------
Author: ASF GitHub Bot
Created on: 03/May/21 23:39
Start Date: 03/May/21 23:39
Worklog Time Spent: 10m
Work Description: TheNeuralBit commented on a change in pull request
#14586:
URL: https://github.com/apache/beam/pull/14586#discussion_r625432079
##########
File path:
sdks/java/io/google-cloud-platform/src/main/java/org/apache/beam/sdk/io/gcp/bigquery/BigQueryStorageArrowReader.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 org.apache.beam.sdk.io.gcp.bigquery;
+
+import com.google.cloud.bigquery.storage.v1.ArrowSchema;
+import com.google.cloud.bigquery.storage.v1.ReadRowsResponse;
+import com.google.cloud.bigquery.storage.v1.ReadSession;
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.channels.Channels;
+import java.util.Iterator;
+import javax.annotation.Nullable;
+import org.apache.arrow.memory.RootAllocator;
+import org.apache.arrow.vector.VectorLoader;
+import org.apache.arrow.vector.VectorSchemaRoot;
+import org.apache.arrow.vector.ipc.ReadChannel;
+import org.apache.arrow.vector.ipc.message.ArrowRecordBatch;
+import org.apache.arrow.vector.ipc.message.MessageSerializer;
+import org.apache.arrow.vector.types.pojo.Schema;
Review comment:
I think this should be possible - one approach would be to add another
method to `ArrowConversion` like `rowFromSerializedRecordBatch` which takes the
serialized bytes and handles the creation of a `VectorSchemaRoot`, which we
currently do here.
I think this would actually be a cleaner approach, since it would mean we
create the resources we need for each `ReadRowsResponse` in
`processReadRowsResponse`, then we can clean them all up in `resetBuffer`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 592484)
Time Spent: 29h (was: 28h 50m)
> BigQuery IO should support reading Arrow format over Storage API
> ----------------------------------------------------------------
>
> Key: BEAM-8933
> URL: https://issues.apache.org/jira/browse/BEAM-8933
> Project: Beam
> Issue Type: Improvement
> Components: io-java-gcp
> Reporter: Kirill Kozlov
> Assignee: Miguel Anzo
> Priority: P3
> Time Spent: 29h
> Remaining Estimate: 0h
>
> As of right now BigQuery uses Avro format for reading and writing.
> We should add a config to BigQueryIO to specify which format to use: Arrow or
> Avro (with Avro as default).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)