You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datafusion.apache.org by bl...@apache.org on 2026/02/06 14:59:24 UTC
(datafusion-sandbox) 35/44: fix: datatype_is_logically_equal for dictionaries
This is an automated email from the ASF dual-hosted git repository.
blaginin pushed a commit to branch annarose/dict-coercion
in repository https://gitbox.apache.org/repos/asf/datafusion-sandbox.git
commit 09c29d755964c1e7235a43a3d3aefbae2852b855
Author: Anna-Rose Lescure <an...@datadoghq.com>
AuthorDate: Wed Feb 4 16:26:50 2026 +0100
fix: datatype_is_logically_equal for dictionaries
---
datafusion/common/src/dfschema.rs | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/datafusion/common/src/dfschema.rs b/datafusion/common/src/dfschema.rs
index f67e7e451..de6d87401 100644
--- a/datafusion/common/src/dfschema.rs
+++ b/datafusion/common/src/dfschema.rs
@@ -700,8 +700,10 @@ impl DFSchema {
(DataType::Dictionary(_, v1), DataType::Dictionary(_, v2)) => {
v1.as_ref() == v2.as_ref()
}
- (DataType::Dictionary(_, v1), othertype) => v1.as_ref() == othertype,
- (othertype, DataType::Dictionary(_, v1)) => v1.as_ref() == othertype,
+ (DataType::Dictionary(_, v1), othertype)
+ | (othertype, DataType::Dictionary(_, v1)) => {
+ Self::datatype_is_logically_equal(v1.as_ref(), othertype)
+ }
(DataType::List(f1), DataType::List(f2))
| (DataType::LargeList(f1), DataType::LargeList(f2))
| (DataType::FixedSizeList(f1, _), DataType::FixedSizeList(f2, _)) => {
@@ -1798,6 +1800,12 @@ mod tests {
&DataType::Utf8,
&DataType::Dictionary(Box::new(DataType::Int32), Box::new(DataType::Utf8))
));
+
+ // Dictionary is logically equal to logically equivalent value type
+ assert!(DFSchema::datatype_is_logically_equal(
+ &DataType::Utf8View,
+ &DataType::Dictionary(Box::new(DataType::Int32), Box::new(DataType::Utf8))
+ ));
}
#[test]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datafusion.apache.org
For additional commands, e-mail: commits-help@datafusion.apache.org