Stefan-Dienst commented on code in PR #3070:
URL: https://github.com/apache/iceberg-rust/pull/3070#discussion_r4057743615
##########
crates/iceberg/src/scan/mod.rs:
##########
@@ -1881,6 +1886,29 @@ pub mod tests {
);
}
+ #[test]
+ fn test_case_insensitive_scan_rejects_ambiguous_column_name() {
Review Comment:
The naming promises a test of a scan, but only `resolve_field_id` is tested.
Maybe rename and add another test that uses a table case insensitive table scan.
##########
crates/iceberg/src/scan/mod.rs:
##########
@@ -1881,6 +1886,29 @@ pub mod tests {
);
}
+ #[test]
+ fn test_case_insensitive_scan_rejects_ambiguous_column_name() {
+ let schema = Schema::builder()
+ .with_fields(vec![
+ NestedField::optional(1, "id",
PrimitiveType::Int.into()).into(),
+ NestedField::optional(2, "ID",
PrimitiveType::Int.into()).into(),
+ ])
+ .build()
+ .unwrap();
+
+ assert_eq!(resolve_field_id(&schema, "id", true).unwrap(), Some(1));
+ let error = resolve_field_id(&schema, "Id", false).unwrap_err();
+ assert_eq!(error.kind(), ErrorKind::DataInvalid);
+ assert!(error.to_string().contains("ambiguous"), "{error}");
+
+ let error = Reference::new("Id")
+ .is_null()
+ .bind(Arc::new(schema), false)
+ .unwrap_err();
+ assert_eq!(error.kind(), ErrorKind::DataInvalid);
+ assert!(error.to_string().contains("ambiguous"), "{error}");
+ }
Review Comment:
Shouldn't this be tested in the term module?
--
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]