@@ -331,7 +331,7 @@ impl RelationPlanner for TableSamplePlanner {
331331 index_hints,
332332 } = relation
333333 else {
334- return Ok ( RelationPlanning :: Original ( relation) ) ;
334+ return Ok ( RelationPlanning :: Original ( Box :: new ( relation) ) ) ;
335335 } ;
336336
337337 // Extract sample spec (handles both before/after alias positions)
@@ -401,7 +401,9 @@ impl RelationPlanner for TableSamplePlanner {
401401
402402 let fraction = bucket_num as f64 / total as f64 ;
403403 let plan = TableSamplePlanNode :: new ( input, fraction, seed) . into_plan ( ) ;
404- return Ok ( RelationPlanning :: Planned ( PlannedRelation :: new ( plan, alias) ) ) ;
404+ return Ok ( RelationPlanning :: Planned ( Box :: new ( PlannedRelation :: new (
405+ plan, alias,
406+ ) ) ) ) ;
405407 }
406408
407409 // Handle quantity-based sampling
@@ -422,15 +424,19 @@ impl RelationPlanner for TableSamplePlanner {
422424 let plan = LogicalPlanBuilder :: from ( input)
423425 . limit ( 0 , Some ( rows as usize ) ) ?
424426 . build ( ) ?;
425- Ok ( RelationPlanning :: Planned ( PlannedRelation :: new ( plan, alias) ) )
427+ Ok ( RelationPlanning :: Planned ( Box :: new ( PlannedRelation :: new (
428+ plan, alias,
429+ ) ) ) )
426430 }
427431
428432 // TABLESAMPLE (N PERCENT) - percentage sampling
429433 Some ( TableSampleUnit :: Percent ) => {
430434 let percent: f64 = parse_literal :: < Float64Type > ( & quantity_value_expr) ?;
431435 let fraction = percent / 100.0 ;
432436 let plan = TableSamplePlanNode :: new ( input, fraction, seed) . into_plan ( ) ;
433- Ok ( RelationPlanning :: Planned ( PlannedRelation :: new ( plan, alias) ) )
437+ Ok ( RelationPlanning :: Planned ( Box :: new ( PlannedRelation :: new (
438+ plan, alias,
439+ ) ) ) )
434440 }
435441
436442 // TABLESAMPLE (N) - fraction if <1.0, row limit if >=1.0
@@ -448,7 +454,9 @@ impl RelationPlanner for TableSamplePlanner {
448454 // Interpret as fraction
449455 TableSamplePlanNode :: new ( input, value, seed) . into_plan ( )
450456 } ;
451- Ok ( RelationPlanning :: Planned ( PlannedRelation :: new ( plan, alias) ) )
457+ Ok ( RelationPlanning :: Planned ( Box :: new ( PlannedRelation :: new (
458+ plan, alias,
459+ ) ) ) )
452460 }
453461 }
454462 }
0 commit comments