-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(csharp/src/Drivers/Apache): add connect and query timeout options #2312
feat(csharp/src/Drivers/Apache): add connect and query timeout options #2312
Conversation
…s - unimplemented
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. One small nit (that I should have done already).
…ancellationToken fully
Converted to draft because I'm trying to resolve failing tests |
These have changed now. |
@CurtHagenlocher - A lot of churn on this PR - but I'd say it is ready for review, if you have the time. Thanks. |
HI @CurtHagenlocher - let me know if you have some time to review this PR. Thanks, again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvement! I've left a bunch of feedback.
csharp/src/Client/AdbcCommand.cs
Outdated
@@ -114,10 +115,31 @@ public override CommandType CommandType | |||
} | |||
} | |||
|
|||
/// <summary> | |||
/// Gets or setts the name of the command timeout property for the underlying ADBC driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: sets
That said, I feel like this is a dubious design choice. If there were a standard for command timeout properties in ADBC then we could hook into that from the wrapper. But if the consumer needs to have custom code anyway in order to set the command timeout, then I think we're better off just exposing the ability to set statement options through DbCommand -- it's equally usable for this case, and more generally useful for other unanticipated cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that a particular driver may define this in a unit other than seconds given the lack of a standard.
As a suggestion, if the property name were on the ADO.NET connection string, it could be used much more transparently because the consumer will already have to have a generic mechanism for setting connection string properties. With this API, the consumer has to know explicitly that they're using a wrapped ADBC driver in order to be able to use the CommandTimeout
API.
csharp/src/Drivers/Apache/Apache.Arrow.Adbc.Drivers.Apache.csproj
Outdated
Show resolved
Hide resolved
…nnect-query-timeout-stub
Can linked cancellation tokens be used for this? |
@@ -114,10 +116,32 @@ public override CommandType CommandType | |||
} | |||
} | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra blank line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks good overall. I do think the API for making the CommandTimeout
work should be a little more consumer-friendly by allowing it to be set on the connection string. And for consistency, we should probably support DbConnection.ConnectionTimeout
in a similar way. But these could be done in a followup. Remove that extra blank line and let me know if you want to check this in without those changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
…ng (#2352) Follow up to #2312 to add parsing of the timeout values and other custom properties like StructBehavior and DecimalBehavior from the connection string. --------- Co-authored-by: David Coe <[email protected]> Co-authored-by: Bruce Irschick <[email protected]>
Adds options for command and query timeout
adbc.spark.connect_timeout_ms
30000
adbc.apache.statement.query_timeout_s
60