nathaniel-d-ef commented on code in PR #8492:
URL: https://github.com/apache/arrow-rs/pull/8492#discussion_r2395328073
##########
arrow-avro/src/codec.rs:
##########
@@ -1011,25 +1018,48 @@ impl<'a> Resolver<'a> {
}
}
+fn full_name_set(name: &str, ns: Option<&str>, aliases: &[&str]) ->
HashSet<String> {
+ let mut out = HashSet::with_capacity(1 + aliases.len());
+ let (full, _) = make_full_name(name, ns, None);
+ out.insert(full);
+ for a in aliases {
+ let (fa, _) = make_full_name(a, None, ns);
+ out.insert(fa);
+ }
+ out
+}
+
fn names_match(
writer_name: &str,
+ writer_namespace: Option<&str>,
writer_aliases: &[&str],
reader_name: &str,
+ reader_namespace: Option<&str>,
reader_aliases: &[&str],
) -> bool {
- writer_name == reader_name
- || reader_aliases.contains(&writer_name)
- || writer_aliases.contains(&reader_name)
+ let writer_set = full_name_set(writer_name, writer_namespace,
writer_aliases);
+ let reader_set = full_name_set(reader_name, reader_namespace,
reader_aliases);
+ // If the canonical full names match, or any alias matches cross-wise.
+ !writer_set.is_disjoint(&reader_set)
}
fn ensure_names_match(
data_type: &str,
writer_name: &str,
Review Comment:
Not at all
--
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]