@@ -18,8 +18,6 @@ import (
18
18
"context"
19
19
"testing"
20
20
21
- "github.com/stretchr/testify/require"
22
-
23
21
"github.com/matrixorigin/matrixone/pkg/common/mpool"
24
22
"github.com/matrixorigin/matrixone/pkg/container/batch"
25
23
"github.com/matrixorigin/matrixone/pkg/container/types"
@@ -31,6 +29,7 @@ import (
31
29
"github.com/matrixorigin/matrixone/pkg/testutil"
32
30
"github.com/matrixorigin/matrixone/pkg/vm"
33
31
"github.com/matrixorigin/matrixone/pkg/vm/process"
32
+ "github.com/stretchr/testify/require"
34
33
)
35
34
36
35
type filterTestCase struct {
@@ -45,9 +44,6 @@ func init() {
45
44
boolType := types .T_bool .ToType ()
46
45
int32Type := types .T_int32 .ToType ()
47
46
48
- fr0 , _ := function .GetFunctionByName (context .TODO (), "and" , []types.Type {boolType , boolType })
49
- fid0 := fr0 .GetEncodedOverloadID ()
50
-
51
47
fr1 , _ := function .GetFunctionByName (context .TODO (), ">" , []types.Type {int32Type , int32Type })
52
48
fid1 := fr1 .GetEncodedOverloadID ()
53
49
@@ -59,27 +55,29 @@ func init() {
59
55
{
60
56
proc : testutil .NewProcessWithMPool ("" , mpool .MustNewZero ()),
61
57
arg : & Filter {
62
- E : & plan.Expr {
63
- Typ : plan2 .MakePlan2Type (& boolType ),
64
- Expr : & plan.Expr_F {
65
- F : & plan.Function {
66
- Func : & plan.ObjectRef {
67
- ObjName : ">" ,
68
- Obj : fid1 ,
69
- },
58
+ FilterExprs : []* plan.Expr {
59
+ {
60
+ Typ : plan2 .MakePlan2Type (& boolType ),
61
+ Expr : & plan.Expr_F {
62
+ F : & plan.Function {
63
+ Func : & plan.ObjectRef {
64
+ ObjName : ">" ,
65
+ Obj : fid1 ,
66
+ },
70
67
71
- Args : []* plan.Expr {
72
- {
73
- Typ : plan2 .MakePlan2Type (& int32Type ),
74
- Expr : & plan.Expr_Col {
75
- Col : & plan.ColRef {
76
- RelPos : 0 ,
77
- ColPos : 0 ,
78
- Name : "a" ,
68
+ Args : []* plan.Expr {
69
+ {
70
+ Typ : plan2 .MakePlan2Type (& int32Type ),
71
+ Expr : & plan.Expr_Col {
72
+ Col : & plan.ColRef {
73
+ RelPos : 0 ,
74
+ ColPos : 0 ,
75
+ Name : "a" ,
76
+ },
79
77
},
80
78
},
79
+ makePlan2Int32ConstExprWithType (10 ),
81
80
},
82
- makePlan2Int32ConstExprWithType (10 ),
83
81
},
84
82
},
85
83
},
@@ -98,64 +96,53 @@ func init() {
98
96
{
99
97
proc : testutil .NewProcessWithMPool ("" , mpool .MustNewZero ()),
100
98
arg : & Filter {
101
- E : & plan.Expr {
102
- Typ : plan2 .MakePlan2Type (& boolType ),
103
- Expr : & plan.Expr_F {
104
- F : & plan.Function {
105
- Func : & plan.ObjectRef {
106
- ObjName : "and" ,
107
- Obj : fid0 ,
108
- },
109
- Args : []* plan.Expr {
110
- {
111
- Typ : plan2 .MakePlan2Type (& boolType ),
112
- Expr : & plan.Expr_F {
113
- F : & plan.Function {
114
- Func : & plan.ObjectRef {
115
- ObjName : ">" ,
116
- Obj : fid1 ,
117
- },
99
+ FilterExprs : []* plan.Expr {
100
+ {
101
+ Typ : plan2 .MakePlan2Type (& boolType ),
102
+ Expr : & plan.Expr_F {
103
+ F : & plan.Function {
104
+ Func : & plan.ObjectRef {
105
+ ObjName : ">" ,
106
+ Obj : fid1 ,
107
+ },
118
108
119
- Args : []* plan.Expr {
120
- {
121
- Typ : plan2 .MakePlan2Type (& int32Type ),
122
- Expr : & plan.Expr_Col {
123
- Col : & plan.ColRef {
124
- RelPos : 0 ,
125
- ColPos : 0 ,
126
- Name : "a" ,
127
- },
128
- },
129
- },
130
- makePlan2Int32ConstExprWithType (10 ),
109
+ Args : []* plan.Expr {
110
+ {
111
+ Typ : plan2 .MakePlan2Type (& int32Type ),
112
+ Expr : & plan.Expr_Col {
113
+ Col : & plan.ColRef {
114
+ RelPos : 0 ,
115
+ ColPos : 0 ,
116
+ Name : "a" ,
131
117
},
132
118
},
133
119
},
120
+ makePlan2Int32ConstExprWithType (10 ),
121
+ },
122
+ },
123
+ },
124
+ },
125
+ {
126
+ Typ : plan2 .MakePlan2Type (& boolType ),
127
+ Expr : & plan.Expr_F {
128
+ F : & plan.Function {
129
+ Func : & plan.ObjectRef {
130
+ ObjName : "<" ,
131
+ Obj : fid2 ,
134
132
},
135
- {
136
- Typ : plan2 .MakePlan2Type (& boolType ),
137
- Expr : & plan.Expr_F {
138
- F : & plan.Function {
139
- Func : & plan.ObjectRef {
140
- ObjName : "<" ,
141
- Obj : fid2 ,
142
- },
143
133
144
- Args : []* plan.Expr {
145
- {
146
- Typ : plan2 .MakePlan2Type (& int32Type ),
147
- Expr : & plan.Expr_Col {
148
- Col : & plan.ColRef {
149
- RelPos : 0 ,
150
- ColPos : 1 ,
151
- Name : "b" ,
152
- },
153
- },
154
- },
155
- makePlan2Int32ConstExprWithType (40 ),
134
+ Args : []* plan.Expr {
135
+ {
136
+ Typ : plan2 .MakePlan2Type (& int32Type ),
137
+ Expr : & plan.Expr_Col {
138
+ Col : & plan.ColRef {
139
+ RelPos : 0 ,
140
+ ColPos : 1 ,
141
+ Name : "b" ,
156
142
},
157
143
},
158
144
},
145
+ makePlan2Int32ConstExprWithType (40 ),
159
146
},
160
147
},
161
148
},
0 commit comments