Skip to content

Commit 8af9c9c

Browse files
msrathore-dbclaude
andcommitted
fix(csharp): use predetermined type per info code in BuildGetInfoResult
VendorSql → bool, all others → string. The union type is determined by the code, not by runtime type inspection of the value. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent bb4dc21 commit 8af9c9c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

csharp/src/Hive2/MetadataSchemaDefinitions.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,18 @@ internal static IArrowArrayStream BuildGetInfoResult(
332332
{
333333
infoNameBuilder.Append((uint)code);
334334

335+
// Union type is predetermined per info code:
336+
// VendorSql → bool, all others → string
337+
bool isBoolCode = code == AdbcInfoCode.VendorSql;
338+
335339
if (values.TryGetValue(code, out object? val) && val != null)
336340
{
337-
if (val is bool boolVal)
341+
if (isBoolCode)
338342
{
339343
typeBuilder.Append(boolValTypeId);
340344
offsetBuilder.Append(offset++);
341345
stringInfoBuilder.AppendNull();
342-
booleanInfoBuilder.Append(boolVal);
346+
booleanInfoBuilder.Append(val is bool b && b);
343347
}
344348
else
345349
{

0 commit comments

Comments
 (0)