birschick-bq commented on code in PR #2018:
URL: https://github.com/apache/arrow-adbc/pull/2018#discussion_r1714415038
##########
csharp/src/Drivers/Apache/Spark/SparkDatabase.cs:
##########
@@ -28,9 +30,15 @@ public SparkDatabase(IReadOnlyDictionary<string, string>
properties)
this.properties = properties;
}
- public override AdbcConnection Connect(IReadOnlyDictionary<string,
string>? properties)
+ public override AdbcConnection Connect(IReadOnlyDictionary<string,
string>? options)
{
- SparkConnection connection = new SparkConnection(this.properties);
+ // connection options takes precedence over database properties
for the same option
+ IReadOnlyDictionary<string, string> mergedProperties = options ==
null
+ ? properties
+ : options
+ .Concat(properties.Where(x =>
!options.Keys.Contains(x.Key, StringComparer.OrdinalIgnoreCase)))
+ .ToDictionary(kvp => kvp.Key, kvp => kvp.Value);
+ SparkConnection connection =
SparkConnectionFactory.NewConnection(mergedProperties); // new
SparkConnection(mergedProperties);
Review Comment:
The `adbc.spark.type` parameter is now required and used to determine which
Spark variant connection will be used.
##########
csharp/src/Drivers/Apache/Spark/SparkConnection.cs:
##########
@@ -32,14 +32,12 @@
using Apache.Arrow.Ipc;
using Apache.Arrow.Types;
using Apache.Hive.Service.Rpc.Thrift;
-using Thrift;
-using Thrift.Protocol;
namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
{
- public class SparkConnection : HiveServer2Connection
+ internal abstract class SparkConnection : HiveServer2Connection
Review Comment:
Now an abstract class to be used for common properties/methods for specific
Spark variants.
--
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]