MCPcopy Create free account
hub / github.com/apache/datafusion / new

Method new

datafusion/physical-plan/src/recursive_query.rs:281–307  ·  view source on GitHub ↗

Create a new recursive query stream

(
        task_context: Arc<TaskContext>,
        work_table: Arc<WorkTable>,
        recursive_term: Arc<dyn ExecutionPlan>,
        static_stream: SendableRecordBatchStream,
        is_distinct: boo

Source from the content-addressed store, hash-verified

279impl RecursiveQueryStream {
280 /// Create a new recursive query stream
281 fn new(
282 task_context: Arc<TaskContext>,
283 work_table: Arc<WorkTable>,
284 recursive_term: Arc<dyn ExecutionPlan>,
285 static_stream: SendableRecordBatchStream,
286 is_distinct: bool,
287 baseline_metrics: BaselineMetrics,
288 ) -> Result<Self> {
289 let schema = static_stream.schema();
290 let reservation =
291 MemoryConsumer::new("RecursiveQuery").register(task_context.memory_pool());
292 let distinct_deduplicator = is_distinct
293 .then(|| DistinctDeduplicator::new(Arc::clone(&schema), &task_context))
294 .transpose()?;
295 Ok(Self {
296 task_context,
297 work_table,
298 recursive_term,
299 static_stream: Some(static_stream),
300 recursive_stream: None,
301 schema,
302 buffer: vec![],
303 reservation,
304 distinct_deduplicator,
305 baseline_metrics,
306 })
307 }
308
309 /// Push a clone of the given batch to the in memory buffer, and then return
310 /// a poll with it.

Callers

nothing calls this directly

Calls 5

newFunction · 0.85
new_group_valuesFunction · 0.85
memory_poolMethod · 0.80
schemaMethod · 0.45
registerMethod · 0.45

Tested by

no test coverage detected