adamreeve commented on code in PR #342:
URL: https://github.com/apache/arrow-dotnet/pull/342#discussion_r3164723544


##########
src/Apache.Arrow.Scalars/Variant/VariantValue.cs:
##########
@@ -152,37 +143,47 @@ public static VariantValue FromDecimal(decimal value)
             {
                 return FromDecimal8(value);
             }
-            return FromDecimal16(value);
+            return new VariantValue(VariantPrimitiveType.Decimal16, 
(object)value);

Review Comment:
   I think this should be
   ```suggestion
               return new VariantValue(VariantPrimitiveType.Decimal16, 
(object)new SqlDecimal(value));
   ```
   `AsSqlDecimal` handles the case when a Decimal16 type is stored as 
`decimal`, and `_objectValue` isn't exposed directly. But `GetHashCode` will 
give different results for the same variant value depending on whether 
`_objectValue` is a `SqlDecimal` or a `decimal`.



-- 
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]

Reply via email to