Skip to content

Commit 5bab65b

Browse files
committed
fix: datatype_is_logically_equal for (Dict, Dict)
1 parent 09c29d7 commit 5bab65b

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

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)) => {
@@ -1806,6 +1806,21 @@ mod tests {
18061806
&DataType::Utf8View,
18071807
&DataType::Dictionary(Box::new(DataType::Int32), Box::new(DataType::Utf8))
18081808
));
1809+
1810+
assert!(DFSchema::datatype_is_logically_equal(
1811+
&DataType::Dictionary(
1812+
Box::new(DataType::Int32),
1813+
Box::new(DataType::List(
1814+
Field::new("element", DataType::Utf8, false).into()
1815+
))
1816+
),
1817+
&DataType::Dictionary(
1818+
Box::new(DataType::Int32),
1819+
Box::new(DataType::List(
1820+
Field::new("element", DataType::Utf8View, false).into()
1821+
))
1822+
)
1823+
));
18091824
}
18101825

18111826
#[test]

0 commit comments

Comments
 (0)