Skip to content
Open
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
4 changes: 1 addition & 3 deletions csharp/src/Http/UserAgentHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,7 @@ internal static class UserAgentHelper
/// <param name="properties">Connection properties (optional, for user_agent_entry).</param>
/// <returns>The User-Agent string.</returns>
/// <remarks>
/// This is used for internal driver HTTP requests like feature flag fetching.
/// Statement execution uses a different User-Agent (DatabricksJDBCDriverOSS) for
/// server-side feature compatibility.
/// Used for all driver HTTP requests (feature flags, Thrift, and SEA statement execution).
/// </remarks>
public static string GetUserAgent(string assemblyVersion, IReadOnlyDictionary<string, string>? properties = null)
{
Expand Down
16 changes: 2 additions & 14 deletions csharp/src/StatementExecution/StatementExecutionConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,23 +304,11 @@ private static string GetHost(IReadOnlyDictionary<string, string> properties)

/// <summary>
/// Builds the user agent string for HTTP requests.
/// Format: DatabricksJDBCDriverOSS/{version} (ADBC)
/// Uses DatabricksJDBCDriverOSS prefix for server-side feature compatibility.
/// Uses the same format as Thrift mode for consistency.
/// </summary>
private string GetUserAgent(IReadOnlyDictionary<string, string> properties)
{
// Use DatabricksJDBCDriverOSS prefix for server-side feature compatibility
// (e.g., INLINE_OR_EXTERNAL_LINKS disposition support)
string baseUserAgent = $"DatabricksJDBCDriverOSS/{AssemblyVersion} (ADBC)";

// Check if a client has provided a user-agent entry
string userAgentEntry = PropertyHelper.GetStringProperty(properties, "adbc.spark.user_agent_entry", string.Empty);
if (!string.IsNullOrWhiteSpace(userAgentEntry))
{
return $"{baseUserAgent} {userAgentEntry}";
}

return baseUserAgent;
return UserAgentHelper.GetUserAgent(AssemblyVersion, properties);
}

/// <summary>
Expand Down
Loading