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
10 changes: 8 additions & 2 deletions csharp/src/FlatColumnsResultBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
2 changes: 0 additions & 2 deletions csharp/test/E2E/StatementTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, string> { ["adbc.databricks.use_desc_table_extended"] = $"{useDescTableExtended}" };

using AdbcConnection connection = NewConnection(TestConfiguration, connectionParams);
Expand Down
Loading