Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion datafusion-testing
10 changes: 2 additions & 8 deletions datafusion/core/src/datasource/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,14 +191,8 @@ mod tests {
]);

let adapter = DefaultSchemaAdapterFactory::from_schema(Arc::new(table_schema));
let (mapper, indices) = adapter.map_schema(&file_schema).unwrap();
assert_eq!(indices, vec![0]);

let file_batch = record_batch!(("b", Float64, vec![1.0, 2.0])).unwrap();

// Mapping fails because it tries to fill in a non-nullable column with nulls
let err = mapper.map_batch(file_batch).unwrap_err().to_string();
assert!(err.contains("Invalid argument error: Column 'a' is declared as non-nullable but contains null values"), "{err}");
let err = adapter.map_schema(&file_schema).unwrap_err().to_string();
assert!(err.contains("Error during planning: Column a is missing from the file schema, cannot be generated, and is non-nullable"));
}

#[derive(Debug)]
Expand Down
Loading