eric-wang-1990 commented on code in PR #3617:
URL: https://github.com/apache/arrow-adbc/pull/3617#discussion_r2480184115
##########
csharp/src/Drivers/Databricks/DatabricksStatement.cs:
##########
@@ -88,22 +89,34 @@ public DatabricksStatement(DatabricksConnection connection)
/// <returns>The Arrow schema</returns>
protected override Schema
GetSchemaFromMetadata(TGetResultSetMetadataResp metadata)
{
+ // Log schema parsing decision
+ Activity.Current?.SetTag("statement.schema.has_arrow_schema",
metadata.__isset.arrowSchema);
+
// For Protocol V5+, prefer Arrow schema if available
if (metadata.__isset.arrowSchema)
{
Schema? arrowSchema =
((DatabricksSchemaParser)Connection.SchemaParser).ParseArrowSchema(metadata.ArrowSchema);
if (arrowSchema != null)
{
+ Activity.Current?.SetTag("statement.schema.source",
"arrow");
+ Activity.Current?.SetTag("statement.schema.column_count",
arrowSchema.FieldsList.Count);
+
Activity.Current?.AddEvent("statement.schema.using_arrow_schema");
Review Comment:
Let's remove this event, you already have tag as arrow
##########
csharp/src/Drivers/Databricks/DatabricksStatement.cs:
##########
@@ -88,22 +89,34 @@ public DatabricksStatement(DatabricksConnection connection)
/// <returns>The Arrow schema</returns>
protected override Schema
GetSchemaFromMetadata(TGetResultSetMetadataResp metadata)
{
+ // Log schema parsing decision
+ Activity.Current?.SetTag("statement.schema.has_arrow_schema",
metadata.__isset.arrowSchema);
+
// For Protocol V5+, prefer Arrow schema if available
if (metadata.__isset.arrowSchema)
{
Schema? arrowSchema =
((DatabricksSchemaParser)Connection.SchemaParser).ParseArrowSchema(metadata.ArrowSchema);
if (arrowSchema != null)
{
+ Activity.Current?.SetTag("statement.schema.source",
"arrow");
+ Activity.Current?.SetTag("statement.schema.column_count",
arrowSchema.FieldsList.Count);
+
Activity.Current?.AddEvent("statement.schema.using_arrow_schema");
return arrowSchema;
}
}
// Fallback to traditional Thrift schema
- return Connection.SchemaParser.GetArrowSchema(metadata.Schema,
Connection.DataTypeConversion);
+ Activity.Current?.SetTag("statement.schema.source", "thrift");
+ Activity.Current?.AddEvent("statement.schema.fallback_to_thrift");
Review Comment:
Remove this event
##########
csharp/src/Drivers/Databricks/DatabricksStatement.cs:
##########
@@ -173,6 +210,8 @@ public override void SetOption(string key, string value)
{
long maxBytesPerFileValue =
DatabricksConnection.ParseBytesWithUnits(value);
this.maxBytesPerFile = maxBytesPerFileValue;
+
Activity.Current?.SetTag("statement.cloudfetch.max_bytes_per_file",
this.maxBytesPerFile);
Review Comment:
These are duplicates, you already logged these in SetStatementProperties
##########
csharp/src/Drivers/Databricks/DatabricksStatement.cs:
##########
@@ -173,6 +210,8 @@ public override void SetOption(string key, string value)
{
long maxBytesPerFileValue =
DatabricksConnection.ParseBytesWithUnits(value);
this.maxBytesPerFile = maxBytesPerFileValue;
+
Activity.Current?.SetTag("statement.cloudfetch.max_bytes_per_file",
this.maxBytesPerFile);
Review Comment:
And remove all the other logs in this function.
--
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]