toddmeng-db commented on code in PR #3140:
URL: https://github.com/apache/arrow-adbc/pull/3140#discussion_r2213774571
##########
csharp/src/Drivers/Databricks/DatabricksStatement.cs:
##########
@@ -64,10 +64,53 @@ public DatabricksStatement(DatabricksConnection connection)
enablePKFK = connection.EnablePKFK;
}
+ /// <summary>
+ /// Gets the schema from metadata response. Handles both Arrow schema
(Protocol V5+) and traditional Thrift schema.
+ /// </summary>
+ /// <param name="metadata">The metadata response containing schema
information</param>
+ /// <returns>The Arrow schema</returns>
+ protected override Schema
GetSchemaFromMetadata(TGetResultSetMetadataResp metadata)
+ {
+ // For Protocol V5+, prefer Arrow schema if available
+ if (metadata.__isset.arrowSchema)
+ {
+ Schema? arrowSchema =
((DatabricksSchemaParser)Connection.SchemaParser).ParseArrowSchema(metadata.ArrowSchema);
+ if (arrowSchema != null)
+ {
+ return arrowSchema;
+ }
+ }
+
+ // Fallback to traditional Thrift schema
+ return Connection.SchemaParser.GetArrowSchema(metadata.Schema,
Connection.DataTypeConversion);
Review Comment:
Yes, I'll need to take a look at other places this is used
--
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]