You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sedona.apache.org by "jesspav (via GitHub)" <gi...@apache.org> on 2025/09/12 03:43:40 UTC
[PR] [WIP] Add argument matcher or [sedona-db]
jesspav opened a new pull request, #69:
URL: https://github.com/apache/sedona-db/pull/69
Adding an or argument matcher for when multiple argument types are ok, for example excepting both SRIDs (numeric) and CRS authority codes (utf8) to a transform.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Add argument matcher or [sedona-db]
Posted by "jiayuasu (via GitHub)" <gi...@apache.org>.
jiayuasu merged PR #69:
URL: https://github.com/apache/sedona-db/pull/69
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add argument matcher or [sedona-db]
Posted by "paleolimbot (via GitHub)" <gi...@apache.org>.
paleolimbot commented on code in PR #69:
URL: https://github.com/apache/sedona-db/pull/69#discussion_r2342877629
##########
rust/sedona-schema/src/matchers.rs:
##########
@@ -253,6 +260,21 @@ impl TypeMatcher for OptionalMatcher {
}
}
+#[derive(Debug)]
+struct OrMatcher {
+ matchers: Vec<Arc<dyn TypeMatcher + Send + Sync>>,
+}
+
+impl TypeMatcher for OrMatcher {
+ fn match_type(&self, arg: &SedonaType) -> bool {
+ self.matchers.iter().any(|m| m.match_type(arg))
+ }
+
+ fn type_if_null(&self) -> Option<SedonaType> {
+ self.matchers.get(0).and_then(|m| m.type_if_null())
Review Comment:
I think we might have to return `None` here (i.e., we're not sure what the creator of this matcher wants a null to be cast to).
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [WIP] Add argument matcher or [sedona-db]
Posted by "jesspav (via GitHub)" <gi...@apache.org>.
jesspav commented on code in PR #69:
URL: https://github.com/apache/sedona-db/pull/69#discussion_r2342886792
##########
rust/sedona-schema/src/matchers.rs:
##########
@@ -253,6 +260,21 @@ impl TypeMatcher for OptionalMatcher {
}
}
+#[derive(Debug)]
+struct OrMatcher {
+ matchers: Vec<Arc<dyn TypeMatcher + Send + Sync>>,
+}
+
+impl TypeMatcher for OrMatcher {
+ fn match_type(&self, arg: &SedonaType) -> bool {
+ self.matchers.iter().any(|m| m.match_type(arg))
+ }
+
+ fn type_if_null(&self) -> Option<SedonaType> {
+ self.matchers.get(0).and_then(|m| m.type_if_null())
Review Comment:
sounds good.
--
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: issues-unsubscribe@sedona.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org