@@ -566,6 +566,7 @@ func (r opResult) createAndWrapRowSource(
566566 core * execinfrapb.ProcessorCoreUnion ,
567567 post * execinfrapb.PostProcessSpec ,
568568 processorID int32 ,
569+ stageID int32 ,
569570 factory coldata.ColumnFactory ,
570571 causeToWrap error ,
571572) error {
@@ -592,7 +593,7 @@ func (r opResult) createAndWrapRowSource(
592593 // here because when wrapping the processor, the materializer will
593594 // be its output, and it will be set up in wrapRowSources.
594595 proc , err := args .ProcessorConstructor (
595- ctx , flowCtx , processorID , core , post , inputs , args .LocalProcessors ,
596+ ctx , flowCtx , processorID , stageID , core , post , inputs , args .LocalProcessors ,
596597 )
597598 if err != nil {
598599 return nil , err
@@ -819,7 +820,7 @@ func NewColOperator(
819820 post = & newPosts [1 ]
820821 err = result .createAndWrapRowSource (
821822 ctx , flowCtx , args , inputs , inputTypes , core ,
822- wrappingPost , spec .ProcessorID , factory , err ,
823+ wrappingPost , spec .ProcessorID , spec . StageID , factory , err ,
823824 )
824825 } else {
825826 switch {
@@ -969,7 +970,8 @@ func NewColOperator(
969970 if canUseDirectScan () {
970971 scanOp , resultTypes , err = colfetcher .NewColBatchDirectScan (
971972 ctx , colmem .NewAllocator (ctx , accounts [0 ], factory ), accounts [1 ],
972- flowCtx , spec .ProcessorID , core .TableReader , post , args .TypeResolver ,
973+ flowCtx , spec .ProcessorID , spec .StageID , core .TableReader , post ,
974+ args .TypeResolver ,
973975 )
974976 if err != nil {
975977 return r , err
@@ -979,7 +981,8 @@ func NewColOperator(
979981 if scanOp == nil {
980982 scanOp , resultTypes , err = colfetcher .NewColBatchScan (
981983 ctx , colmem .NewAllocator (ctx , accounts [0 ], factory ), accounts [1 ],
982- flowCtx , spec .ProcessorID , core .TableReader , post , estimatedRowCount , args .TypeResolver ,
984+ flowCtx , spec .ProcessorID , spec .StageID , core .TableReader , post ,
985+ estimatedRowCount , args .TypeResolver ,
983986 )
984987 if err != nil {
985988 return r , err
@@ -1027,7 +1030,7 @@ func NewColOperator(
10271030 result .ColumnTypes = spec .Input [0 ].ColumnTypes
10281031 result .Root = inputs [0 ].Root
10291032 if err := result .planAndMaybeWrapFilter (
1030- ctx , flowCtx , args , spec .ProcessorID , core .Filterer .Filter , factory ,
1033+ ctx , flowCtx , args , spec .ProcessorID , spec . StageID , core .Filterer .Filter , factory ,
10311034 ); err != nil {
10321035 return r , err
10331036 }
@@ -1309,7 +1312,7 @@ func NewColOperator(
13091312
13101313 if ! core .HashJoiner .OnExpr .Empty () && core .HashJoiner .Type == descpb .InnerJoin {
13111314 if err = result .planAndMaybeWrapFilter (
1312- ctx , flowCtx , args , spec .ProcessorID , core .HashJoiner .OnExpr , factory ,
1315+ ctx , flowCtx , args , spec .ProcessorID , spec . StageID , core .HashJoiner .OnExpr , factory ,
13131316 ); err != nil {
13141317 return r , err
13151318 }
@@ -1354,7 +1357,7 @@ func NewColOperator(
13541357
13551358 if onExpr != nil {
13561359 if err = result .planAndMaybeWrapFilter (
1357- ctx , flowCtx , args , spec .ProcessorID , * onExpr , factory ,
1360+ ctx , flowCtx , args , spec .ProcessorID , spec . StageID , * onExpr , factory ,
13581361 ); err != nil {
13591362 return r , err
13601363 }
@@ -1797,7 +1800,8 @@ func NewColOperator(
17971800 }
17981801 err = ppr .planPostProcessSpec (ctx , flowCtx , args , post , factory , & r .Releasables , args .Spec .EstimatedRowCount )
17991802 if err != nil {
1800- err = result .wrapPostProcessSpec (ctx , flowCtx , args , post , spec .ProcessorID , factory , err )
1803+ err = result .wrapPostProcessSpec (ctx , flowCtx , args , post ,
1804+ spec .ProcessorID , spec .StageID , factory , err )
18011805 } else {
18021806 // The result can be updated with the post process result.
18031807 r .Root = ppr .Op
@@ -1845,7 +1849,8 @@ func NewColOperator(
18451849 post .RenderExprs [i ].LocalExpr = tree .NewTypedOrdinalReference (i , args .Spec .ResultTypes [i ])
18461850 }
18471851 }
1848- if err = result .wrapPostProcessSpec (ctx , flowCtx , args , post , spec .ProcessorID , factory , errWrappedCast ); err != nil {
1852+ if err = result .wrapPostProcessSpec (ctx , flowCtx , args , post ,
1853+ spec .ProcessorID , spec .StageID , factory , errWrappedCast ); err != nil {
18491854 return r , err
18501855 }
18511856 } else if numMismatchedTypes > 0 {
@@ -1909,6 +1914,7 @@ func (r opResult) planAndMaybeWrapFilter(
19091914 flowCtx * execinfra.FlowCtx ,
19101915 args * colexecargs.NewColOperatorArgs ,
19111916 processorID int32 ,
1917+ stageID int32 ,
19121918 filter execinfrapb.Expression ,
19131919 factory coldata.ColumnFactory ,
19141920) error {
@@ -1928,7 +1934,7 @@ func (r opResult) planAndMaybeWrapFilter(
19281934 return r .createAndWrapRowSource (
19291935 ctx , flowCtx , args , []colexecargs.OpWithMetaInfo {inputToMaterializer },
19301936 [][]* types.T {r .ColumnTypes }, filtererCore , & execinfrapb.PostProcessSpec {},
1931- processorID , factory , err ,
1937+ processorID , stageID , factory , err ,
19321938 )
19331939 }
19341940 return nil
@@ -1945,6 +1951,7 @@ func (r opResult) wrapPostProcessSpec(
19451951 args * colexecargs.NewColOperatorArgs ,
19461952 post * execinfrapb.PostProcessSpec ,
19471953 processorID int32 ,
1954+ stageID int32 ,
19481955 factory coldata.ColumnFactory ,
19491956 causeToWrap error ,
19501957) error {
@@ -1956,7 +1963,8 @@ func (r opResult) wrapPostProcessSpec(
19561963 // createAndWrapRowSource updates r.ColumnTypes accordingly.
19571964 return r .createAndWrapRowSource (
19581965 ctx , flowCtx , args , []colexecargs.OpWithMetaInfo {inputToMaterializer },
1959- [][]* types.T {r .ColumnTypes }, noopCore , post , processorID , factory , causeToWrap ,
1966+ [][]* types.T {r .ColumnTypes }, noopCore , post , processorID , stageID , factory ,
1967+ causeToWrap ,
19601968 )
19611969}
19621970
0 commit comments