Skip to content

Commit

Permalink
fix(go/adbc/driver/snowflake): fix precision/scale in table schema (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ruowan authored Mar 25, 2024
1 parent ff866d9 commit 4e0175f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions csharp/src/Client/SchemaConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ public static DataTable ConvertArrowSchema(Schema schema, AdbcStatement adbcStat
f.HasMetadata
)
{
if (f.Metadata.TryGetValue("precision", out string precisionKey))
if (f.Metadata.TryGetValue("precision", out string precisionValue))
{
if(!string.IsNullOrEmpty(precisionKey))
row[SchemaTableColumn.NumericPrecision] = Convert.ToInt32(f.Metadata[precisionKey]);
if(!string.IsNullOrEmpty(precisionValue))
row[SchemaTableColumn.NumericPrecision] = Convert.ToInt32(precisionValue);
}

if(f.Metadata.TryGetValue("scale", out string scaleKey))
if(f.Metadata.TryGetValue("scale", out string scaleValue))
{
if(!string.IsNullOrEmpty(scaleKey))
row[SchemaTableColumn.NumericScale] = Convert.ToInt32(f.Metadata[scaleKey]);
if(!string.IsNullOrEmpty(scaleValue))
row[SchemaTableColumn.NumericScale] = Convert.ToInt32(scaleValue);
}
}
else if (f.DataType is Decimal128Type decimal128Type)
Expand Down

0 comments on commit 4e0175f

Please sign in to comment.