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


##########
crates/datafusion/src/read/file_scan_task_provider/provider.rs:
##########
@@ -0,0 +1,66 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+use std::any::Any;
+use std::fmt::{Debug, Formatter};
+use std::sync::Arc;
+
+use datafusion::common::Result;
+use datafusion::execution::TaskContext;
+use datafusion::physical_plan::Partitioning;
+use iceberg::table::Table;
+
+/// Supplies the file tasks an 
[`IcebergDataSource`](crate::read::IcebergDataSource)
+/// reads, split into output partitions.
+///
+/// The data source owns reading, limits and metrics; implementations only
+/// decide which files each partition reads and when they are discovered.
+/// Implementations are `Any`, so consumers such as codecs can downcast a
+/// source's 
[`file_scan_task_provider`](crate::read::IcebergDataSource::file_scan_task_provider)
+/// to a concrete type:
+///
+/// ```
+/// # use std::any::Any;
+/// # use iceberg_datafusion::read::{IcebergDataSource, 
EagerFileScanTaskProvider};
+/// fn planned_files(source: &IcebergDataSource) -> 
Option<&EagerFileScanTaskProvider> {
+///     (source.file_scan_task_provider() as &dyn 
Any).downcast_ref::<EagerFileScanTaskProvider>()
+/// }
+/// ```
+pub trait FileScanTaskProvider: Any + Debug + Send + Sync {

Review Comment:
   @alexanderbianchi this could be hour hooking point in DFD for injecting our 
WorkUnitFeed, so the idea here is to kill two birds with one stone:
   - providing polymorphism that supports both eager and lazy execution modes
   - provide a public hooking point for injecting custom FileScanTask streams, 
like DFD's WorkUnitFeed



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