birschick-bq commented on code in PR #2312:
URL: https://github.com/apache/arrow-adbc/pull/2312#discussion_r1851152711


##########
csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs:
##########
@@ -40,12 +41,26 @@ protected virtual void 
SetStatementProperties(TExecuteStatementReq statement)
 
         public override async ValueTask<QueryResult> ExecuteQueryAsync()
         {
-            await ExecuteStatementAsync();
-            await HiveServer2Connection.PollForResponseAsync(OperationHandle!, 
Connection.Client, PollTimeMilliseconds);
-            Schema schema = await GetResultSetSchemaAsync(OperationHandle!, 
Connection.Client);
+            try
+            {
+                CancellationToken timeoutToken = 
ApacheUtility.GetCancellationToken(QueryTimeoutSeconds, 
ApacheUtility.TimeUnit.Seconds);
+
+                // this could either:
+                // take QueryTimeoutSeconds * 3
+                // OR
+                // take QueryTimeoutSeconds (but this could be restricting)
+
+                await ExecuteStatementAsync(timeoutToken); // --> get 
QueryTimeout +
+                await 
HiveServer2Connection.PollForResponseAsync(OperationHandle!, Connection.Client, 
PollTimeMilliseconds, timeoutToken); // + poll, up to QueryTimeout
+                Schema schema = await 
GetResultSetSchemaAsync(OperationHandle!, Connection.Client, timeoutToken); // 
+ get the result, up to QueryTimeout
 
-            // TODO: Ensure this is set dynamically based on server 
capabilities
-            return new QueryResult(-1, Connection.NewReader(this, schema));
+                // TODO: Ensure this is set dynamically based on server 
capabilities

Review Comment:
   ```suggestion
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to