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


##########
crates/datafusion/src/read/file_scan_task_provider/lazy.rs:
##########
@@ -0,0 +1,259 @@
+// 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::fmt::Formatter;
+use std::sync::Arc;
+
+use datafusion::arrow::datatypes::SchemaRef;
+use datafusion::common::{Result, exec_err};
+use datafusion::execution::TaskContext;
+use datafusion::physical_plan::Partitioning;
+use datafusion::prelude::Expr;
+use futures::TryStreamExt;
+use iceberg::expr::Predicate;
+use iceberg::table::Table;
+
+use super::eager::EagerFileScanTaskProvider;
+use super::provider::{FileScanTaskProvider, FileScanTaskProviderContext};
+use crate::IcebergDataFusionConfig;
+use crate::read::convert_filters_to_predicate;
+use crate::to_datafusion_error;
+
+/// Discovers files while executing, in a single partition: the files of a
+/// snapshot that may match a predicate.
+#[derive(Debug, Clone)]
+pub struct LazyFileScanTaskProvider {
+    table: Table,
+    schema: SchemaRef,
+    snapshot_id: Option<i64>,
+    projection: Vec<String>,
+    predicate: Option<Predicate>,
+}
+
+impl LazyFileScanTaskProvider {
+    /// Consumes discovery and retains its tasks in round-robin groups, using 
the
+    /// context's target partition count. The result no longer retains the 
table.
+    /// Empty discovery produces one empty group. Dropping this future drops 
the
+    /// discovery stream; this method does not spawn a background collector.
+    pub async fn into_eager(

Review Comment:
   @gabotechs what do you think of something like this? I find it a bit cleaner 
then `try_with_eagerly_planned_file_scan_tasks`



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