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
| 279 | impl 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. |
nothing calls this directly
no test coverage detected