diff --git a/csharp/src/FlatColumnsResultBuilder.cs b/csharp/src/FlatColumnsResultBuilder.cs index 30ae73e0..b412dc84 100644 --- a/csharp/src/FlatColumnsResultBuilder.cs +++ b/csharp/src/FlatColumnsResultBuilder.cs @@ -71,8 +71,14 @@ internal static QueryResult BuildFlatColumnsResult( if (info.Precision[i].HasValue) columnSizeBuilder.Append(info.Precision[i]!.Value); else columnSizeBuilder.AppendNull(); - int? bufLen = ColumnMetadataHelper.GetBufferLength(info.TypeName[i]); - if (bufLen.HasValue) bufferLengthBuilder.Append(bufLen.Value); else bufferLengthBuilder.AppendNull(); + // BUFFER_LENGTH is an ODBC carryover (SQLColumns col 8): the byte size an ODBC + // application would allocate to bind/fetch the column into its own C buffer. + // Managed APIs that own their buffers have no use for it, so JDBC marks it + // "not used" — and ADBC even less so, since results are self-describing Arrow + // (buffer sizes come from the column's type + data, not from a metadata field). + // Always null here, matching the Thrift path and the SEA DESC TABLE EXTENDED path. + // (ADBC surfaces the same field as xdbc_buffer_length.) + bufferLengthBuilder.AppendNull(); if (info.Scale[i].HasValue) decimalDigitsBuilder.Append(info.Scale[i]!.Value); else decimalDigitsBuilder.AppendNull(); diff --git a/csharp/test/E2E/StatementTests.cs b/csharp/test/E2E/StatementTests.cs index be3f28e4..17a6d92f 100644 --- a/csharp/test/E2E/StatementTests.cs +++ b/csharp/test/E2E/StatementTests.cs @@ -476,13 +476,11 @@ public async Task CanGetColumnsWithBaseTypeName() Assert.Equal(TestConfiguration.Metadata.ExpectedColumnCount, actualBatchLength); } - // TODO: PECO-3008 - CanGetColumnsExtended fails for SEA; investigate catalog/schema metadata path in StatementExecutionConnection [SkippableTheory] [InlineData("all_column_types", "Resources/create_table_all_types.sql", "Resources/result_get_column_extended_all_types.json", true, new[] { "PK_IS_NULLABLE:NO" })] [InlineData("all_column_types", "Resources/create_table_all_types.sql", "Resources/result_get_column_extended_all_types.json", false, new[] { "PK_IS_NULLABLE:YES" })] public async Task CanGetColumnsExtended(string tableName, string createTableSqlLocation, string resultLocation, bool useDescTableExtended, string[]? extraPlaceholdsInResult = null) { - Skip.If(TestConfiguration.Protocol == "rest", "SEA CanGetColumnsExtended returns different BUFFER_LENGTH values (PECO-3008)"); var connectionParams = new Dictionary { ["adbc.databricks.use_desc_table_extended"] = $"{useDescTableExtended}" }; using AdbcConnection connection = NewConnection(TestConfiguration, connectionParams);