xudong963 commented on code in PR #17242:
URL: https://github.com/apache/datafusion/pull/17242#discussion_r2312471072
##########
datafusion-examples/examples/advanced_parquet_index.rs:
##########
@@ -491,23 +492,22 @@ impl TableProvider for IndexTableProvider {
CachedParquetFileReaderFactory::new(Arc::clone(&self.object_store))
.with_file(indexed_file);
- let file_source = Arc::new(
- ParquetSource::default()
+ let file_scan_config = FileScanConfigBuilder::new(object_store_url,
schema)
+ .with_limit(limit)
+ .with_projection(projection.cloned())
+ .with_file(partitioned_file)
+ .build();
+
+ let file_source =
+ ParquetSource::new(TableParquetOptions::default(),
file_scan_config.clone())
// provide the predicate so the DataSourceExec can try and
prune
// row groups internally
.with_predicate(predicate)
// provide the factory to create parquet reader without
re-reading metadata
- .with_parquet_file_reader_factory(Arc::new(reader_factory)),
- );
- let file_scan_config =
- FileScanConfigBuilder::new(object_store_url, schema, file_source)
- .with_limit(limit)
- .with_projection(projection.cloned())
- .with_file(partitioned_file)
- .build();
+ .with_parquet_file_reader_factory(Arc::new(reader_factory));
// Finally, put it all together into a DataSourceExec
- Ok(DataSourceExec::from_data_source(file_scan_config))
Review Comment:
The biggest point of the refactor
--
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]