adriangb commented on code in PR #18627:
URL: https://github.com/apache/datafusion/pull/18627#discussion_r2562771090
##########
datafusion-examples/examples/custom_data_source/csv_json_opener.rs:
##########
@@ -64,22 +64,22 @@ async fn csv_opener() -> Result<()> {
..Default::default()
};
- let scan_config = FileScanConfigBuilder::new(
- ObjectStoreUrl::local_filesystem(),
-
Arc::new(CsvSource::new(Arc::clone(&schema)).with_csv_options(options.clone())),
- )
- .with_projection_indices(Some(vec![12, 0]))
- .with_limit(Some(5))
- .with_file(PartitionedFile::new(path.display().to_string(), 10))
- .build();
-
- let config = CsvSource::new(Arc::clone(&schema))
+ let source = CsvSource::new(Arc::clone(&schema))
.with_csv_options(options)
.with_comment(Some(b'#'))
- .with_batch_size(8192)
- .with_projection(&scan_config);
+ .with_batch_size(8192);
+
+ let scan_config =
+ FileScanConfigBuilder::new(ObjectStoreUrl::local_filesystem(), source)
+ .with_projection_indices(Some(vec![12, 0]))?
+ .with_limit(Some(5))
+ .with_file(PartitionedFile::new(path.display().to_string(), 10))
+ .build();
- let opener = config.create_file_opener(object_store, &scan_config, 0);
+ let opener =
+ scan_config
+ .file_source()
Review Comment:
Yeah I'll leave it untouched for now.
--
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]