alexanderbianchi commented on code in PR #109:
URL: 
https://github.com/apache/datafusion-iceberg/pull/109#discussion_r4602826890


##########
crates/datafusion/src/table_provider/static_table_provider.rs:
##########
@@ -120,19 +121,25 @@ impl TableProvider for IcebergStaticTableProvider {
 
     async fn scan(
         &self,
-        _state: &dyn Session,
+        state: &dyn Session,
         projection: Option<&Vec<usize>>,
         filters: &[Expr],
         limit: Option<usize>,
     ) -> Result<Arc<dyn ExecutionPlan>> {
         // Use cached table (no refresh)
-        let source = IcebergDataSource::builder(self.table.clone(), 
self.schema.clone())
+        let mut builder = IcebergDataSourceBuilder::new(&self.table, 
self.schema.clone())
             .with_snapshot_id(self.snapshot_id)
             .with_projection(projection)
             .with_filters(filters)
-            .with_fetch(limit)
-            .build()?;
-        Ok(DataSourceExec::from_data_source(source))
+            .with_fetch(limit);
+
+        let iceberg_cfg = 
IcebergDataFusionConfig::from_config_or_default(state.config());
+        if iceberg_cfg.execution.eager_file_planning {
+            builder = builder
+                .try_with_eagerly_planned_file_scan_tasks(state)
+                .await?;

Review Comment:
   Should we just make `build()` async instead of having an async 
configuration? IMO more clear, and if anything in the builder impacts the 
manifest pruning it'll be available in `Build()` and we won't have to worry 
about the "state" at the time `try_with_eagerly_planned_file_scan_tasks`. 
Alternatively we can have a `build_eagerly()` or something like it that's 
async, but always called at the end.



-- 
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]

Reply via email to