Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions csharp/src/Drivers/Apache/Hive2/HiveServer2Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ internal abstract class HiveServer2Connection : TracingConnection
internal const bool InfoVendorSql = true;
internal const long BatchSizeDefault = 50000;
internal const int PollTimeMillisecondsDefault = 500;
internal static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(HiveServer2Connection));
internal static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(HiveServer2Connection));
private const int ConnectTimeoutMillisecondsDefault = 30000;
private TTransport? _transport;
private TCLIService.IAsync? _client;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Hive2
internal class HiveServer2HttpConnection : HiveServer2ExtendedConnection
{
private const string BasicAuthenticationScheme = "Basic";
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(HiveServer2HttpConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(HiveServer2HttpConnection));

private readonly HiveServer2ProxyConfigurator _proxyConfigurator;

Expand Down
6 changes: 2 additions & 4 deletions csharp/src/Drivers/Apache/Hive2/HiveServer2Reader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ internal class HiveServer2Reader : TracingReader
{
{ ArrowTypeId.Float, ConvertToFloat },
};
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(HiveServer2Reader));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(HiveServer2Reader));

public HiveServer2Reader(
HiveServer2Statement statement,
Expand All @@ -89,9 +87,9 @@ public HiveServer2Reader(

public override Schema Schema { get; }

public override string AssemblyName => s_assemblyName;
public override string AssemblyName => HiveServer2Connection.s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;
public override string AssemblyVersion => HiveServer2Connection.s_assemblyVersion;

public override async ValueTask<RecordBatch?> ReadNextRecordBatchAsync(CancellationToken cancellationToken = default)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Hive2
{
internal class HiveServer2StandardConnection : HiveServer2ExtendedConnection
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(HiveServer2StandardConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(HiveServer2StandardConnection));

public HiveServer2StandardConnection(IReadOnlyDictionary<string, string> properties) : base(properties)
{
}
Expand Down
6 changes: 2 additions & 4 deletions csharp/src/Drivers/Apache/Hive2/HiveServer2Statement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ internal class HiveServer2Statement : TracingStatement
// Add constants for PK and FK field names and prefixes
protected static readonly string[] PrimaryKeyFields = new[] { "COLUMN_NAME" };
protected static readonly string[] ForeignKeyFields = new[] { "PKCOLUMN_NAME", "PKTABLE_CAT", "PKTABLE_SCHEM", "PKTABLE_NAME", "FKCOLUMN_NAME", "FK_NAME", "KEQ_SEQ" };
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(HiveServer2Statement));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(HiveServer2Statement));
protected const string PrimaryKeyPrefix = "PK_";
protected const string ForeignKeyPrefix = "FK_";

Expand Down Expand Up @@ -353,9 +351,9 @@ protected internal int QueryTimeoutSeconds
// Keep the original Client property for internal use
public TCLIService.IAsync Client => Connection.Client;

public override string AssemblyName => s_assemblyName;
public override string AssemblyName => HiveServer2Connection.s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;
public override string AssemblyVersion => HiveServer2Connection.s_assemblyVersion;

private void UpdatePollTimeIfValid(string key, string value) => PollTimeMilliseconds = !string.IsNullOrEmpty(key) && int.TryParse(value, result: out int pollTimeMilliseconds) && pollTimeMilliseconds >= 0
? pollTimeMilliseconds
Expand Down
2 changes: 0 additions & 2 deletions csharp/src/Drivers/Apache/Impala/ImpalaHttpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Impala
internal class ImpalaHttpConnection : ImpalaConnection
{
private const string BasicAuthenticationScheme = "Basic";
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(ImpalaHttpConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(ImpalaHttpConnection));

private readonly HiveServer2ProxyConfigurator _proxyConfigurator;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Impala
{
internal class ImpalaStandardConnection : ImpalaConnection
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(ImpalaStandardConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(ImpalaStandardConnection));

public ImpalaStandardConnection(IReadOnlyDictionary<string, string> properties) : base(properties)
{
}
Expand Down
7 changes: 2 additions & 5 deletions csharp/src/Drivers/Apache/Impala/ImpalaStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Impala
{
internal class ImpalaStatement : HiveServer2Statement
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(ImpalaStatement));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(ImpalaStatement));

internal ImpalaStatement(ImpalaConnection connection)
: base(connection)
{
Expand All @@ -37,8 +34,8 @@ public sealed class Options : ApacheParameters
// options specific to Impala go here
}

public override string AssemblyName => s_assemblyName;
public override string AssemblyName => HiveServer2Connection.s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;
public override string AssemblyVersion => HiveServer2Connection.s_assemblyVersion;
}
}
2 changes: 0 additions & 2 deletions csharp/src/Drivers/Apache/Spark/SparkHttpConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ internal class SparkHttpConnection : SparkConnection
{
private const string BasicAuthenticationScheme = "Basic";
private const string BearerAuthenticationScheme = "Bearer";
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(SparkHttpConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(SparkHttpConnection));

protected readonly HiveServer2ProxyConfigurator _proxyConfigurator;

Expand Down
3 changes: 0 additions & 3 deletions csharp/src/Drivers/Apache/Spark/SparkStandardConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
{
internal class SparkStandardConnection : SparkHttpConnection
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(SparkStandardConnection));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(SparkStandardConnection));

public SparkStandardConnection(IReadOnlyDictionary<string, string> properties) : base(properties)
{
}
Expand Down
7 changes: 2 additions & 5 deletions csharp/src/Drivers/Apache/Spark/SparkStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ namespace Apache.Arrow.Adbc.Drivers.Apache.Spark
{
internal class SparkStatement : HiveServer2Statement
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(SparkStatement));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(SparkStatement));

internal SparkStatement(SparkConnection connection)
: base(connection)
{
Expand Down Expand Up @@ -56,8 +53,8 @@ protected override void SetStatementProperties(TExecuteStatementReq statement)
};
}

public override string AssemblyName => s_assemblyName;
public override string AssemblyName => HiveServer2Connection.s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;
public override string AssemblyVersion => HiveServer2Connection.s_assemblyVersion;
}
}
9 changes: 5 additions & 4 deletions csharp/src/Drivers/Databricks/BaseDatabricksReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
*/

using System;
using System.Threading;
using System.Threading.Tasks;
using Apache.Arrow;
using Apache.Arrow.Adbc.Drivers.Apache;
using Apache.Arrow.Adbc.Tracing;
using Apache.Arrow.Ipc;

namespace Apache.Arrow.Adbc.Drivers.Databricks
{
Expand Down Expand Up @@ -93,5 +90,9 @@ protected void ThrowIfDisposed()
throw new ObjectDisposedException(GetType().Name);
}
}

public override string AssemblyName => DatabricksConnection.s_assemblyName;

public override string AssemblyVersion => DatabricksConnection.s_assemblyVersion;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Apache.Arrow.Adbc.Drivers.Apache;
using Apache.Arrow.Adbc.Tracing;
using Apache.Arrow.Ipc;
using Apache.Hive.Service.Rpc.Thrift;
Expand All @@ -33,9 +32,6 @@ namespace Apache.Arrow.Adbc.Drivers.Databricks.CloudFetch
/// </summary>
internal sealed class CloudFetchReader : BaseDatabricksReader
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(CloudFetchReader));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(CloudFetchReader));

private ICloudFetchDownloadManager? downloadManager;
private ArrowStreamReader? currentReader;
private IDownloadResult? currentDownloadResult;
Expand Down Expand Up @@ -80,10 +76,6 @@ public CloudFetchReader(DatabricksStatement statement, Schema schema, TFetchResu
}
}

public override string AssemblyName => s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;

/// <summary>
/// Reads the next record batch from the result set.
/// </summary>
Expand Down
7 changes: 2 additions & 5 deletions csharp/src/Drivers/Databricks/DatabricksCompositeReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,9 @@ namespace Apache.Arrow.Adbc.Drivers.Databricks
/// </summary>
internal sealed class DatabricksCompositeReader : TracingReader
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(DatabricksCompositeReader));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(DatabricksCompositeReader));
public override string AssemblyName => DatabricksConnection.s_assemblyName;

public override string AssemblyName => s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;
public override string AssemblyVersion => DatabricksConnection.s_assemblyVersion;

public override Schema Schema { get { return _schema; } }

Expand Down
9 changes: 7 additions & 2 deletions csharp/src/Drivers/Databricks/DatabricksConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
using Apache.Arrow.Adbc.Drivers.Apache.Hive2.Client;
using Apache.Arrow.Adbc.Drivers.Apache.Spark;
using Apache.Arrow.Adbc.Drivers.Databricks.Auth;
using Apache.Arrow.Adbc.Drivers.Databricks.CloudFetch;
using Apache.Arrow.Adbc.Tracing;
using Apache.Arrow.Ipc;
using Apache.Hive.Service.Rpc.Thrift;
using Thrift.Protocol;
Expand All @@ -38,6 +36,9 @@ namespace Apache.Arrow.Adbc.Drivers.Databricks
{
internal class DatabricksConnection : SparkHttpConnection
{
internal static new readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(DatabricksConnection));
internal static new readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(DatabricksConnection));

private bool _applySSPWithQueries = false;
private bool _enableDirectResults = true;
private bool _enableMultipleCatalogSupport = true;
Expand Down Expand Up @@ -648,6 +649,10 @@ protected override void ValidateOAuthParameters()
}
}

public override string AssemblyName => s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;

internal static string? HandleSparkCatalog(string? CatalogName)
{
if (CatalogName != null && CatalogName.Equals("SPARK", StringComparison.OrdinalIgnoreCase))
Expand Down
7 changes: 0 additions & 7 deletions csharp/src/Drivers/Databricks/DatabricksReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ namespace Apache.Arrow.Adbc.Drivers.Databricks
{
internal sealed class DatabricksReader : BaseDatabricksReader
{
private static readonly string s_assemblyName = ApacheUtility.GetAssemblyName(typeof(DatabricksReader));
private static readonly string s_assemblyVersion = ApacheUtility.GetAssemblyVersion(typeof(DatabricksReader));

List<TSparkArrowBatch>? batches;
int index;
IArrowReader? reader;
Expand All @@ -50,10 +47,6 @@ public DatabricksReader(DatabricksStatement statement, Schema schema, TFetchResu
}
}

public override string AssemblyName => s_assemblyName;

public override string AssemblyVersion => s_assemblyVersion;

public override async ValueTask<RecordBatch?> ReadNextRecordBatchAsync(CancellationToken cancellationToken = default)
{
return await this.TraceActivity(async activity =>
Expand Down
5 changes: 5 additions & 0 deletions csharp/src/Drivers/Databricks/DatabricksStatement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System.Text.Json;
using System.Threading;
using System.Threading.Tasks;
using Apache.Arrow.Adbc.Drivers.Apache;
using Apache.Arrow.Adbc.Drivers.Apache.Hive2;
using Apache.Arrow.Adbc.Drivers.Apache.Spark;
using Apache.Arrow.Adbc.Drivers.Databricks.CloudFetch;
Expand Down Expand Up @@ -567,6 +568,10 @@ protected override async Task<QueryResult> GetColumnsExtendedAsync(CancellationT
return CreateExtendedColumnsResult(columnMetadataSchema,result);
}

public override string AssemblyName => DatabricksConnection.s_assemblyName;

public override string AssemblyVersion => DatabricksConnection.s_assemblyVersion;

/// <summary>
/// Creates the schema for the column metadata result set.
/// This schema is used for the GetColumns metadata query.
Expand Down
Loading