kosiew commented on code in PR #21912:
URL: https://github.com/apache/datafusion/pull/21912#discussion_r3167181391
##########
datafusion/physical-plan/src/common.rs:
##########
@@ -26,16 +26,126 @@ use crate::stream::RecordBatchReceiverStream;
use crate::{ColumnStatistics, Statistics};
use arrow::array::Array;
-use arrow::datatypes::Schema;
+use arrow::datatypes::{Schema, SchemaRef};
use arrow::record_batch::RecordBatch;
use datafusion_common::stats::Precision;
-use datafusion_common::{Result, plan_err};
+use datafusion_common::{Result, internal_err, plan_err};
use datafusion_execution::memory_pool::MemoryReservation;
use futures::{StreamExt, TryStreamExt};
+use parking_lot::Mutex;
/// [`MemoryReservation`] used across query execution streams
-pub(crate) type SharedMemoryReservation = Arc<MemoryReservation>;
+pub(crate) type SharedMemoryReservation = Arc<Mutex<MemoryReservation>>;
+
+/// Normalize a [`RecordBatch`] so that its embedded schema matches
`expected_schema`.
+///
+/// Execution operators declare their output schema via
[`crate::ExecutionPlan::schema`], but
+/// child plans—particularly those planned independently such as the recursive
term of
+/// a recursive CTE—may produce batches whose field *names* differ from the
declared
+/// schema even though the data types are identical. Downstream consumers
that key on
Review Comment:
You're right.
Implement ProjectionExec fix
--
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]