Perseus commented on code in PR #47:
URL: https://github.com/apache/datafusion-iceberg/pull/47#discussion_r4237492357
##########
crates/datafusion/src/physical_plan/metadata_scan.rs:
##########
@@ -80,28 +92,40 @@ impl ExecutionPlan for IcebergMetadataScan {
fn apply_expressions(
&self,
- _f: &mut dyn FnMut(
- &Arc<dyn PhysicalExpr>,
- ) -> datafusion::error::Result<TreeNodeRecursion>,
- ) -> datafusion::error::Result<TreeNodeRecursion> {
+ _f: &mut dyn FnMut(&Arc<dyn PhysicalExpr>) ->
Result<TreeNodeRecursion>,
+ ) -> Result<TreeNodeRecursion> {
Ok(TreeNodeRecursion::Continue)
}
fn with_new_children(
self: Arc<Self>,
_children: Vec<Arc<dyn ExecutionPlan>>,
- ) -> datafusion::error::Result<Arc<dyn ExecutionPlan>> {
+ ) -> Result<Arc<dyn ExecutionPlan>> {
Ok(self)
}
fn execute(
&self,
_partition: usize,
_context: Arc<datafusion::execution::TaskContext>,
- ) ->
datafusion::error::Result<datafusion::execution::SendableRecordBatchStream> {
+ ) -> Result<datafusion::execution::SendableRecordBatchStream> {
let fut = self.provider.clone().scan();
- let stream = futures::stream::once(fut).try_flatten();
- let schema = self.provider.schema();
- Ok(Box::pin(RecordBatchStreamAdapter::new(schema, stream)))
+ let projection = self.projection.clone();
+
+ let stream =
+ futures::stream::once(fut)
+ .try_flatten()
+ .map(move |result| -> Result<_> {
+ let batch = result?;
+ match &projection {
+ Some(indices) => Ok(batch.project(indices)?),
+ None => Ok(batch),
+ }
+ });
Review Comment:
👋 I've updated the PR with the latest changes from main, opened an issue in
iceberg-rust https://github.com/apache/iceberg-rust/issues/3391 , and added a
TODO in the code here
--
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]