tustvold commented on code in PR #2572:
URL: https://github.com/apache/arrow-datafusion/pull/2572#discussion_r876251108
##########
datafusion/core/src/datasource/file_format/avro.rs:
##########
@@ -359,36 +358,13 @@ mod tests {
async fn get_exec(
file_name: &str,
- projection: &Option<Vec<usize>>,
+ projection: Option<&[usize]>,
limit: Option<usize>,
) -> Result<Arc<dyn ExecutionPlan>> {
let testdata = crate::test_util::arrow_test_data();
- let filename = format!("{}/avro/{}", testdata, file_name);
+ let store_root = format!("{}/avro", testdata);
let format = AvroFormat {};
- let file_schema = format
- .infer_schema(local_object_reader_stream(vec![filename.clone()]))
- .await
- .expect("Schema inference");
- let statistics = format
- .infer_stats(local_object_reader(filename.clone()),
file_schema.clone())
- .await
- .expect("Stats inference");
- let file_groups =
vec![vec![local_unpartitioned_file(filename.to_owned())]];
- let exec = format
- .create_physical_plan(
- FileScanConfig {
- object_store: Arc::new(LocalFileSystem {}),
- file_schema,
- file_groups,
- statistics,
- projection: projection.clone(),
- limit,
- table_partition_cols: vec![],
- },
- &[],
- )
- .await?;
- Ok(exec)
+ get_exec_format(&format, &store_root, file_name, projection,
limit).await
Review Comment:
This is a drive-by-fix to extract the common scanning logic that was
duplicated for each format
--
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]