Skip to content

Commit ddd0927

Browse files
committed
fix: datatype_is_logically_equal for (Dict, Dict)
(cherry picked from commit 5bab65b)
1 parent 4ddfc72 commit ddd0927

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

datafusion/common/src/dfschema.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ impl DFSchema {
698698
// check nested fields
699699
match (dt1, dt2) {
700700
(DataType::Dictionary(_, v1), DataType::Dictionary(_, v2)) => {
701-
v1.as_ref() == v2.as_ref()
701+
Self::datatype_is_logically_equal(v1.as_ref(), v2.as_ref())
702702
}
703703
(DataType::Dictionary(_, v1), othertype)
704704
| (othertype, DataType::Dictionary(_, v1)) => {
@@ -1800,6 +1800,21 @@ mod tests {
18001800
&DataType::Utf8View,
18011801
&DataType::Dictionary(Box::new(DataType::Int32), Box::new(DataType::Utf8))
18021802
));
1803+
1804+
assert!(DFSchema::datatype_is_logically_equal(
1805+
&DataType::Dictionary(
1806+
Box::new(DataType::Int32),
1807+
Box::new(DataType::List(
1808+
Field::new("element", DataType::Utf8, false).into()
1809+
))
1810+
),
1811+
&DataType::Dictionary(
1812+
Box::new(DataType::Int32),
1813+
Box::new(DataType::List(
1814+
Field::new("element", DataType::Utf8View, false).into()
1815+
))
1816+
)
1817+
));
18031818
}
18041819

18051820
#[test]

0 commit comments

Comments
 (0)