You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "davidhcoe (via GitHub)" <gi...@apache.org> on 2024/07/26 13:42:16 UTC

[PR] feat(csharp/src/Drivers/BigQuery): add support for configurable query timeouts [arrow-adbc]

davidhcoe opened a new pull request, #2043:
URL: https://github.com/apache/arrow-adbc/pull/2043

   Adds a new option to support specifying the timeout value for a query


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] feat(csharp/src/Drivers/BigQuery): add support for configurable query timeouts [arrow-adbc]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher merged PR #2043:
URL: https://github.com/apache/arrow-adbc/pull/2043


-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] feat(csharp/src/Drivers/BigQuery): add support for configurable query timeouts [arrow-adbc]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on code in PR #2043:
URL: https://github.com/apache/arrow-adbc/pull/2043#discussion_r1695726282


##########
csharp/src/Drivers/BigQuery/BigQueryConnection.cs:
##########
@@ -997,21 +997,18 @@ public override AdbcStatement CreateStatement()
         {
             Dictionary<string, string> options = new Dictionary<string, string>();
 
+            List<string> statementOptions = new List<string>()

Review Comment:
   Consider using string array instead of string list. Also consider using literal syntax.



##########
csharp/test/Drivers/BigQuery/BigQueryTestingUtils.cs:
##########
@@ -86,6 +86,11 @@ BigQueryTestConfiguration testConfiguration
                 parameters.Add(BigQueryParameters.LargeResultsDestinationTable, testConfiguration.LargeResultsDestinationTable);
             }
 
+            if(testConfiguration.TimeoutMinutes.HasValue)

Review Comment:
   nit: insert space before paren



##########
csharp/src/Drivers/BigQuery/BigQueryStatement.cs:
##########
@@ -55,7 +55,21 @@ public override QueryResult ExecuteQuery()
         {
             QueryOptions? queryOptions = ValidateOptions();
             BigQueryJob job = this.client.CreateQueryJob(SqlQuery, null, queryOptions);
-            BigQueryResults results = job.GetQueryResults();
+
+            GetQueryResultsOptions getQueryResultsOptions = new GetQueryResultsOptions();
+
+            if (this.Options != null && this.Options.ContainsKey(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes))

Review Comment:
   `this.Options.TryGetValue` ?



##########
csharp/src/Drivers/BigQuery/BigQueryConnection.cs:
##########
@@ -997,21 +997,18 @@ public override AdbcStatement CreateStatement()
         {
             Dictionary<string, string> options = new Dictionary<string, string>();
 
+            List<string> statementOptions = new List<string>()
+            {
+                BigQueryParameters.AllowLargeResults,
+                BigQueryParameters.UseLegacySQL,
+                BigQueryParameters.LargeDecimalsAsString,
+                BigQueryParameters.LargeResultsDestinationTable,
+                BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes
+            };
+
             foreach (KeyValuePair<string, string> keyValuePair in this.properties)

Review Comment:
   Consider iterating on the list of supported keywords instead of the list of supplied keywords, to get the advantage of dictionary lookup, e.g.
   
   ```
       foreach (string key in [BigQueryParameters.AllowLargeResults, BigQueryParameters.LargeDecimalsAsString, ... ])
       {
           if (this.properties.TryGetValue(key, out string value))
           {
               options[key] = value;
           }
       }
   ```



-- 
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-unsubscribe@arrow.apache.org

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


Re: [PR] feat(csharp/src/Drivers/BigQuery): add support for configurable query timeouts [arrow-adbc]

Posted by "CurtHagenlocher (via GitHub)" <gi...@apache.org>.
CurtHagenlocher commented on code in PR #2043:
URL: https://github.com/apache/arrow-adbc/pull/2043#discussion_r1697648385


##########
csharp/src/Drivers/BigQuery/BigQueryStatement.cs:
##########
@@ -58,9 +58,9 @@ public override QueryResult ExecuteQuery()
 
             GetQueryResultsOptions getQueryResultsOptions = new GetQueryResultsOptions();
 
-            if (this.Options != null && this.Options.ContainsKey(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes))
+            if (this.Options!.TryGetValue(BigQueryParameters.GetQueryResultsOptionsTimeoutMinutes, out string? timeoutMinutes))

Review Comment:
   I don't think the null-forgiving operator is what's wanted here. At this line of code, this.Options might well be null in which case this will throw. I think what's wanted instead is `if (this.Options?.TryGetValue(...) == true)`.



-- 
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-unsubscribe@arrow.apache.org

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