This is an automated email from the ASF dual-hosted git repository.
curth pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow-adbc.git
The following commit(s) were added to refs/heads/main by this push:
new 2a5232295 fix(csharp/src/Drivers/Apache/Hive2): Add
ServerProtocolVersion in Connection (#2948)
2a5232295 is described below
commit 2a5232295fe0b5cf1dacbc56634ab11a39899c43
Author: Jacky Hu <[email protected]>
AuthorDate: Tue Jun 10 20:05:50 2025 +0800
fix(csharp/src/Drivers/Apache/Hive2): Add ServerProtocolVersion in
Connection (#2948)
# PR Description
## Description
This PR adds property `ServerProtocolVersion` into
`HiveServer2Connection` so that it can be used to check if a certain
feature is supported by the server by checking its ServerProtocolVersion
and only use this feature when ServerProtocolVersion meets the
requirement.
### Changes
- Added the `ServerProtocolVersion` in `HiveServer2Connection`
- Set `ServerProtocolVersion` with the `ServerProtocolVersion` from
`TOpenSessionResp` when opening session
### Motivation
`ServerProtocolVersion` can be used to check if a certain feature is
supported by the server by checking its ServerProtocolVersion and only
use this feature when ServerProtocolVersion meets the requirement.
### Testing
- Verified `ServerProtocolVersion` was set after opening the connection
---
csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs | 3 +++
1 file changed, 3 insertions(+)
diff --git a/csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs
b/csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs
index 672ea6682..e010182d5 100644
--- a/csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs
+++ b/csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs
@@ -340,6 +340,7 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Hive2
}
SessionHandle = session.SessionHandle;
+ ServerProtocolVersion = session.ServerProtocolVersion;
return Task.CompletedTask;
}
@@ -350,6 +351,8 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Hive2
internal TSessionHandle? SessionHandle { get; private set; }
+ internal TProtocolVersion? ServerProtocolVersion { get; private set; }
+
protected internal DataTypeConversion DataTypeConversion { get; set; }
= DataTypeConversion.None;
protected internal TlsProperties TlsOptions { get; set; } = new
TlsProperties();