Skip to content

Commit bcd2d75

Browse files
authored
feat(csharp/src/Drivers/Databricks): Move DescribeTableExtended to version negotiator (#3137)
1 parent 241477e commit bcd2d75

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

csharp/src/Drivers/Databricks/DatabricksConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private void ValidateProperties()
282282
/// <summary>
283283
/// Check if current connection can use `DESC TABLE EXTENDED` query
284284
/// </summary>
285-
internal bool CanUseDescTableExtended => _useDescTableExtended && ServerProtocolVersion != null && ServerProtocolVersion >= TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7;
285+
internal bool CanUseDescTableExtended => _useDescTableExtended && ServerProtocolVersion != null && FeatureVersionNegotiator.SupportsDESCTableExtended(ServerProtocolVersion.Value);
286286

287287
/// <summary>
288288
/// Gets whether PK/FK metadata call is enabled

csharp/src/Drivers/Databricks/FeatureVersionNegotiator.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,18 @@ public static bool SupportsPKFK(TProtocolVersion protocolVersion) =>
9797
* V7 introduced the following features:
9898
* - isStagingOperation
9999
* - resultPersistenceMode: server will determine if this can be enabled
100+
* - DESC TABLE EXTENDED support
100101
101102
*/
102103

104+
/// <summary>
105+
/// Gets whether DESC TABLE EXTENDED queries are supported.
106+
/// </summary>
107+
/// <param name="protocolVersion">The current protocol version.</param>
108+
/// <returns>True if DESC TABLE EXTENDED is supported; otherwise, false.</returns>
109+
public static bool SupportsDESCTableExtended(TProtocolVersion protocolVersion) =>
110+
SupportsProtocolVersion(protocolVersion, TProtocolVersion.SPARK_CLI_SERVICE_PROTOCOL_V7);
111+
103112
#endregion
104113

105114
#region Protocol Version V8 Features

0 commit comments

Comments
 (0)