@@ -2,7 +2,6 @@ package workflow
22
33import (
44 "context"
5- "fmt"
65 "testing"
76 "time"
87
@@ -29,7 +28,7 @@ func TestPlanWorkflow_MetastorePlan_UsesMergeRootAndPointersPartitions(t *testin
2928 start := time .Unix (10 , 0 )
3029 end := start .Add (time .Hour )
3130
32- p := physical .NewMetastorePlanner (ms , 0 )
31+ p := physical .NewMetastorePlanner (ms )
3332 plan , err := p .Plan (context .Background (), nil , nil , start , end )
3433 require .NoError (t , err )
3534
@@ -52,7 +51,7 @@ func TestPlanWorkflow_MetastorePlan_UsesMergeRootAndPointersPartitions(t *testin
5251 for _ , child := range children {
5352 childRoot , err := child .Fragment .Root ()
5453 require .NoError (t , err )
55- require .IsType (t , & physical.PointersScan {}, childRoot , "partition fragment root should be PointersScan when not batching" )
54+ require .IsType (t , & physical.PointersScan {}, childRoot )
5655 gotLocations [childRoot .(* physical.PointersScan ).Location ] = struct {}{}
5756 }
5857
@@ -61,40 +60,3 @@ func TestPlanWorkflow_MetastorePlan_UsesMergeRootAndPointersPartitions(t *testin
6160 require .True (t , ok , "missing partition for %q" , indexPath )
6261 }
6362}
64-
65- func TestPlanWorkflow_MetastorePlan_BatchesPointersScans (t * testing.T ) {
66- paths := make ([]string , 250 )
67- for i := range paths {
68- paths [i ] = fmt .Sprintf ("index/%d" , i )
69- }
70- ms := fakeMetastoreIndexes {indexPaths : paths }
71- start := time .Unix (10 , 0 )
72- end := start .Add (time .Hour )
73-
74- p := physical .NewMetastorePlanner (ms , 100 )
75- plan , err := p .Plan (context .Background (), nil , nil , start , end )
76- require .NoError (t , err )
77-
78- graph , err := planWorkflow ("tenant" , plan )
79- require .NoError (t , err )
80-
81- rootTask , err := graph .Root ()
82- require .NoError (t , err )
83-
84- rootNode , err := rootTask .Fragment .Root ()
85- require .NoError (t , err )
86- require .IsType (t , & physical.Merge {}, rootNode )
87-
88- children := graph .Children (rootTask )
89- require .Len (t , children , 3 , "250 paths with batch 100 should produce 3 tasks (100, 100, 50)" )
90-
91- expectedSizes := []int {100 , 100 , 50 }
92- for i , child := range children {
93- childRoot , err := child .Fragment .Root ()
94- require .NoError (t , err )
95- scanSet , ok := childRoot .(* physical.ScanSet )
96- require .True (t , ok , "child %d: partition fragment root should be ScanSet when batching, got %T" , i , childRoot )
97- require .Len (t , scanSet .Targets , expectedSizes [i ], "child %d: expected %d PointersScan targets" , i , expectedSizes [i ])
98- require .Equal (t , 0 , scanSet .ShardBatchSize , "batched shard should have ShardBatchSize 0" )
99- }
100- }
0 commit comments