klion26 commented on code in PR #10157:
URL: https://github.com/apache/arrow-rs/pull/10157#discussion_r3551383149
##########
parquet-variant/src/variant.rs:
##########
@@ -912,26 +779,27 @@ impl<'m, 'v> Variant<'m, 'v> {
/// let v1 = Variant::from(123i64);
/// assert_eq!(v1.as_int8(), Some(123i8));
///
- /// // or from boolean variant
- /// let v2 = Variant::BooleanFalse;
- /// assert_eq!(v2.as_int8(), Some(0));
- ///
/// // but not if it would overflow
- /// let v3 = Variant::from(1234i64);
- /// assert_eq!(v3.as_int8(), None);
+ /// let v2 = Variant::from(1234i64);
+ /// assert_eq!(v2.as_int8(), None);
///
/// // or if the variant cannot be cast into an integer
- /// let v4 = Variant::from("hello!");
- /// assert_eq!(v4.as_int8(), None);
+ /// let v3 = Variant::from("hello");
+ /// assert_eq!(v3.as_int8(), None);
/// ```
pub fn as_int8(&self) -> Option<i8> {
Review Comment:
I think that decimal with scale = 0 is a decimal, it does not like `100i8`
and `100i32`, so not receive decimal with scale = 0 here.
We can still make decimal with scale = 0 equals to integer in `variant_get`
--
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]