yutannihilation commented on code in PR #255:
URL: https://github.com/apache/sedona-db/pull/255#discussion_r2475833280
##########
rust/sedona-schema/src/matchers.rs:
##########
@@ -356,6 +366,38 @@ impl TypeMatcher for IsNumeric {
}
}
+#[derive(Debug)]
+struct IsInteger {}
+
+impl TypeMatcher for IsInteger {
+ fn match_type(&self, arg: &SedonaType) -> bool {
+ match arg {
+ SedonaType::Arrow(data_type) => data_type.is_integer(),
+ _ => false,
+ }
+ }
+
+ fn type_if_null(&self) -> Option<SedonaType> {
+ Some(SedonaType::Arrow(DataType::Float64))
Review Comment:
Ah, thanks for catching!
##########
rust/sedona-schema/src/matchers.rs:
##########
@@ -356,6 +366,38 @@ impl TypeMatcher for IsNumeric {
}
}
+#[derive(Debug)]
+struct IsInteger {}
+
+impl TypeMatcher for IsInteger {
+ fn match_type(&self, arg: &SedonaType) -> bool {
+ match arg {
+ SedonaType::Arrow(data_type) => data_type.is_integer(),
+ _ => false,
+ }
+ }
+
+ fn type_if_null(&self) -> Option<SedonaType> {
+ Some(SedonaType::Arrow(DataType::Float64))
+ }
+}
+
+#[derive(Debug)]
+struct IsUnsignedInteger {}
+
+impl TypeMatcher for IsUnsignedInteger {
+ fn match_type(&self, arg: &SedonaType) -> bool {
+ match arg {
+ SedonaType::Arrow(data_type) => data_type.is_unsigned_integer(),
+ _ => false,
+ }
+ }
+
+ fn type_if_null(&self) -> Option<SedonaType> {
+ Some(SedonaType::Arrow(DataType::Float64))
Review Comment:
Yeah, I was wondering about it... Maybe I should remove this? We can add
when we find this is actually useful.
--
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]