CurtHagenlocher commented on code in PR #1948:
URL: https://github.com/apache/arrow-adbc/pull/1948#discussion_r1682078433
##########
csharp/src/Drivers/Apache/Apache.Arrow.Adbc.Drivers.Apache.csproj:
##########
@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
+ <NoWarn>CS8618</NoWarn>
Review Comment:
Instead of disabling this warning, it looks like the _statementResp field
should probably just be made nullable.
##########
csharp/test/Drivers/Apache/Spark/DriverTests.cs:
##########
@@ -505,14 +510,71 @@ public async Task CanGetTableTypes()
[SkippableFact, Order(10)]
public void CanExecuteQuery()
{
- using AdbcConnection adbcConnection = NewConnection();
+ long count = 0;
+ long target = 80;
+ Queue<String> log = new Queue<string>();
+ string FileName =
$@"c:\temp\hmsmeta\{DateTime.Now.ToString("yyyyMMdd_HHmm")}__{target}.log";
- using AdbcStatement statement = adbcConnection.CreateStatement();
- statement.SqlQuery = TestConfiguration.Query;
-
- QueryResult queryResult = statement.ExecuteQuery();
+ for (int i = 0; i < target; i++)
+ {
+ ThreadPool.QueueUserWorkItem((_) =>
+ {
+ using AdbcConnection adbcConnection = NewConnection();
+ var sparkConn = adbcConnection as SparkConnection;
+ if(sparkConn == null)
+ {
+ throw new InvalidCastException();
Review Comment:
As this is test code and we're just throwing a cast exception anyway, the
code is a little cleaner as just
```
var sparkConn = (SparkConnection)adbcConnection;
```
(The cast will throw if it's not the right type.)
##########
csharp/test/Drivers/Apache/Spark/DriverTests.cs:
##########
@@ -505,14 +510,71 @@ public async Task CanGetTableTypes()
[SkippableFact, Order(10)]
public void CanExecuteQuery()
{
- using AdbcConnection adbcConnection = NewConnection();
+ long count = 0;
+ long target = 80;
+ Queue<String> log = new Queue<string>();
+ string FileName =
$@"c:\temp\hmsmeta\{DateTime.Now.ToString("yyyyMMdd_HHmm")}__{target}.log";
Review Comment:
Instead of hardcoding a path, please use something like `Path.GetTempPath`
and consider deleting the file once the test has finished.
##########
csharp/src/Drivers/Apache/Spark/SparkConnection.cs:
##########
@@ -278,23 +283,53 @@ protected override async ValueTask<TProtocol>
CreateProtocolAsync()
else
token = properties[SparkParameters.Password];
- HttpClient httpClient = new HttpClient();
- httpClient.BaseAddress = new UriBuilder(Uri.UriSchemeHttps,
hostName, -1, path).Uri;
- httpClient.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue("Bearer", token);
- httpClient.DefaultRequestHeaders.UserAgent.ParseAdd(UserAgent);
- httpClient.DefaultRequestHeaders.AcceptEncoding.Clear();
- httpClient.DefaultRequestHeaders.AcceptEncoding.Add(new
StringWithQualityHeaderValue("identity"));
- httpClient.DefaultRequestHeaders.ExpectContinue = false;
-
TConfiguration config = new TConfiguration();
-
- ThriftHttpTransport transport = new
ThriftHttpTransport(httpClient, config);
+ _httpClient.BaseAddress = new UriBuilder(Uri.UriSchemeHttps,
hostName, -1, path).Uri;
+ _httpClient.DefaultRequestHeaders.Authorization = new
AuthenticationHeaderValue("Bearer", token);
+
_httpClient.DefaultRequestHeaders.UserAgent.ParseAdd("SimbaSparkJDBCDriver/2.06.15
Python/PyHive");
Review Comment:
Is this the best choice for a user-agent? Are we driving some specific
server behavior by sending this?
--
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]