davidhcoe commented on code in PR #3323:
URL: https://github.com/apache/arrow-adbc/pull/3323#discussion_r2291409709


##########
csharp/src/Drivers/BigQuery/BigQueryStatement.cs:
##########
@@ -342,22 +342,31 @@ private IArrowType GetType(TableFieldSchema field, 
IArrowType type)
 
         private static IArrowReader? ReadChunk(BigQueryReadClient client, 
string streamName, Activity? activity)
         {
-            // Ideally we wouldn't need to indirect through a stream, but the 
necessary APIs in Arrow
-            // are internal. (TODO: consider changing Arrow).
-            activity?.AddConditionalBigQueryTag("read_stream", streamName, 
BigQueryUtils.IsSafeToTrace());
-            BigQueryReadClient.ReadRowsStream readRowsStream = 
client.ReadRows(new ReadRowsRequest { ReadStream = streamName });
-            IAsyncEnumerator<ReadRowsResponse> enumerator = 
readRowsStream.GetResponseStream().GetAsyncEnumerator();
+            try
+            {
+                // Ideally we wouldn't need to indirect through a stream, but 
the necessary APIs in Arrow
+                // are internal. (TODO: consider changing Arrow).
+                activity?.AddConditionalBigQueryTag("read_stream", streamName, 
BigQueryUtils.IsSafeToTrace());
+                BigQueryReadClient.ReadRowsStream readRowsStream = 
client.ReadRows(new ReadRowsRequest { ReadStream = streamName });
+                IAsyncEnumerator<ReadRowsResponse> enumerator = 
readRowsStream.GetResponseStream().GetAsyncEnumerator();
 
-            ReadRowsStream stream = new ReadRowsStream(enumerator);
-            activity?.AddBigQueryTag("read_stream.has_rows", stream.HasRows);
+                ReadRowsStream stream = new ReadRowsStream(enumerator);
+                activity?.AddBigQueryTag("read_stream.has_rows", 
stream.HasRows);
 
-            if (stream.HasRows)
-            {
-                return new ArrowStreamReader(stream);
+                if (stream.HasRows)
+                {
+                    return new ArrowStreamReader(stream);
+                }
+                else
+                {
+                    return null;
+                }
             }
-            else
+            catch (Exception ex)
             {
-                return null;
+                activity?.AddException(ex);
+
+                return null; // If there is an error reading the stream, 
return null to indicate no data.

Review Comment:
   My thought here was that it would catch something that maybe _isn't_ related 
to the MoveNextAsync() problem, log the exception and still "function", but I 
suppose it could function incorrectly.



-- 
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.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to