jayzhan211 commented on code in PR #11978:
URL: https://github.com/apache/datafusion/pull/11978#discussion_r1722625285
##########
datafusion/common/src/logical/eq.rs:
##########
@@ -0,0 +1,26 @@
+use arrow_schema::DataType;
+
+pub trait LogicallyEq<Rhs: ?Sized = Self> {
+ #[must_use]
+ fn logically_eq(&self, other: &Rhs) -> bool;
+}
+
+impl LogicallyEq for DataType {
+ fn logically_eq(&self, other: &Self) -> bool {
+ use DataType::*;
+
+ match (self, other) {
+ (Utf8 | LargeUtf8 | Utf8View, Utf8 | LargeUtf8 | Utf8View)
+ | (Binary | LargeBinary | BinaryView, Binary | LargeBinary |
BinaryView) => {
+ true
+ }
+ (Dictionary(_, inner), other) | (other, Dictionary(_, inner)) => {
Review Comment:
We could avoid unnecessary call if we handle both Dict case
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]