Skip to content

Commit 62226d5

Browse files
committed
Support BuiltInFunctionKind enum parameter in BuiltInFunctionHandle's JSON constructor creator
1 parent ab8d57f commit 62226d5

File tree

19 files changed

+188
-105
lines changed

19 files changed

+188
-105
lines changed

presto-main-base/src/main/java/com/facebook/presto/metadata/BuiltInFunctionHandle.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ public class BuiltInFunctionHandle
3333
private final Signature signature;
3434
private final BuiltInFunctionKind builtInFunctionKind;
3535

36-
@JsonCreator
37-
public BuiltInFunctionHandle(@JsonProperty("signature") Signature signature)
36+
public BuiltInFunctionHandle(Signature signature)
3837
{
3938
this(signature, ENGINE);
4039
}
4140

42-
public BuiltInFunctionHandle(Signature signature, BuiltInFunctionKind builtInFunctionKind)
41+
@JsonCreator
42+
public BuiltInFunctionHandle(@JsonProperty("signature") Signature signature, @JsonProperty("builtInFunctionKind") BuiltInFunctionKind builtInFunctionKind)
4343
{
4444
this.signature = requireNonNull(signature, "signature is null");
4545
checkArgument(signature.getTypeVariableConstraints().isEmpty(), "%s has unbound type parameters", signature);

presto-native-execution/presto_cpp/main/tests/data/Fragment.thrift.base64

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

presto-native-execution/presto_cpp/main/types/tests/PrestoToVeloxQueryPlanTest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@ TEST_F(PrestoToVeloxQueryPlanTest, parseIndexJoinNode) {
227227
"returnType": "boolean",
228228
"typeVariableConstraints": [],
229229
"variableArity": false
230-
}
230+
},
231+
"builtInFunctionKind": "ENGINE"
231232
},
232233
"returnType": "boolean"
233234
}

presto-native-execution/presto_cpp/main/types/tests/RowExpressionTest.cpp

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ class RowExpressionTest : public ::testing::Test {
8989
returnTypeField + R"##(,
9090
"typeVariableConstraints": [],
9191
"variableArity": false
92-
}
92+
},
93+
"builtInFunctionKind": "ENGINE"
9394
},
9495
)##" +
9596
returnTypeField + R"##(
@@ -477,7 +478,8 @@ TEST_F(RowExpressionTest, call) {
477478
"returnType": "boolean",
478479
"typeVariableConstraints": [],
479480
"variableArity": false
480-
}
481+
},
482+
"builtInFunctionKind": "ENGINE"
481483
},
482484
"returnType": "boolean"
483485
}
@@ -686,7 +688,8 @@ TEST_F(RowExpressionTest, special) {
686688
"returnType": "boolean",
687689
"typeVariableConstraints": [],
688690
"variableArity": false
689-
}
691+
},
692+
"builtInFunctionKind": "ENGINE"
690693
},
691694
"returnType": "boolean"
692695
},
@@ -718,7 +721,8 @@ TEST_F(RowExpressionTest, special) {
718721
"returnType": "boolean",
719722
"typeVariableConstraints": [],
720723
"variableArity": false
721-
}
724+
},
725+
"builtInFunctionKind": "ENGINE"
722726
},
723727
"returnType": "boolean"
724728
}
@@ -821,7 +825,8 @@ TEST_F(RowExpressionTest, bind) {
821825
"bigint"
822826
],
823827
"variableArity":false
824-
}
828+
},
829+
"builtInFunctionKind": "ENGINE"
825830
},
826831
"returnType":"bigint",
827832
"arguments":[
@@ -844,7 +849,8 @@ TEST_F(RowExpressionTest, bind) {
844849
"integer"
845850
],
846851
"variableArity":false
847-
}
852+
},
853+
"builtInFunctionKind": "ENGINE"
848854
},
849855
"returnType":"bigint",
850856
"arguments":[
@@ -894,7 +900,8 @@ TEST_F(RowExpressionTest, likeSimple) {
894900
"returnType" : "boolean",
895901
"argumentTypes" : [ "varchar", "LikePattern" ],
896902
"variableArity" : false
897-
}
903+
},
904+
"builtInFunctionKind": "ENGINE"
898905
},
899906
"returnType" : "boolean",
900907
"arguments" : [ {
@@ -914,7 +921,8 @@ TEST_F(RowExpressionTest, likeSimple) {
914921
"returnType" : "LikePattern",
915922
"argumentTypes" : [ "varchar" ],
916923
"variableArity" : false
917-
}
924+
},
925+
"builtInFunctionKind": "ENGINE"
918926
},
919927
"returnType" : "LikePattern",
920928
"arguments" : [ {
@@ -953,7 +961,8 @@ TEST_F(RowExpressionTest, likeWithEscape) {
953961
"returnType" : "boolean",
954962
"argumentTypes" : [ "varchar", "LikePattern" ],
955963
"variableArity" : false
956-
}
964+
},
965+
"builtInFunctionKind": "ENGINE"
957966
},
958967
"returnType" : "boolean",
959968
"arguments" : [ {
@@ -973,7 +982,8 @@ TEST_F(RowExpressionTest, likeWithEscape) {
973982
"returnType" : "LikePattern",
974983
"argumentTypes" : [ "varchar", "varchar" ],
975984
"variableArity" : false
976-
}
985+
},
986+
"builtInFunctionKind": "ENGINE"
977987
},
978988
"returnType" : "LikePattern",
979989
"arguments" : [ {
@@ -1029,7 +1039,8 @@ TEST_F(RowExpressionTest, dereference) {
10291039
"bigint"
10301040
],
10311041
"variableArity":false
1032-
}
1042+
},
1043+
"builtInFunctionKind": "ENGINE"
10331044
},
10341045
"returnType":"row(partkey integer,suppkey integer,quantity integer,extendedprice double,discount double,tax double,returnflag varchar(1),linestatus varchar(1),shipdate varchar,commitdate varchar,receiptdate varchar,shipinstruct varchar(25),shipmode varchar(10))",
10351046
"arguments":[
@@ -1053,7 +1064,8 @@ TEST_F(RowExpressionTest, dereference) {
10531064
"integer"
10541065
],
10551066
"variableArity":false
1056-
}
1067+
},
1068+
"builtInFunctionKind": "ENGINE"
10571069
},
10581070
"returnType":"array(row(partkey integer,suppkey integer,quantity integer,extendedprice double,discount double,tax double,returnflag varchar(1),linestatus varchar(1),shipdate varchar,commitdate varchar,receiptdate varchar,shipinstruct varchar(25),shipmode varchar(10)))",
10591071
"arguments":[

presto-native-execution/presto_cpp/main/types/tests/data/FinalAgg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@
122122
"bigint"
123123
],
124124
"variableArity":false
125-
}
125+
},
126+
"builtInFunctionKind": "ENGINE"
126127
},
127128
"returnType":"bigint",
128129
"arguments":[
@@ -157,7 +158,8 @@
157158
"bigint"
158159
],
159160
"variableArity":false
160-
}
161+
},
162+
"builtInFunctionKind": "ENGINE"
161163
}
162164
}
163165
},

presto-native-execution/presto_cpp/main/types/tests/data/OffsetLimit.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@
271271
"bigint"
272272
],
273273
"variableArity":false
274-
}
274+
},
275+
"builtInFunctionKind": "ENGINE"
275276
},
276277
"returnType":"boolean",
277278
"arguments":[

presto-native-execution/presto_cpp/main/types/tests/data/PartitionedOutput.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,8 @@
159159
"map(varchar,bigint)"
160160
],
161161
"variableArity":false
162-
}
162+
},
163+
"builtInFunctionKind": "ENGINE"
163164
},
164165
"returnType":"array(varchar)",
165166
"arguments":[
@@ -200,7 +201,8 @@
200201
"array(varchar)"
201202
],
202203
"variableArity":false
203-
}
204+
},
205+
"builtInFunctionKind": "ENGINE"
204206
},
205207
"returnType":"array(varchar)",
206208
"arguments":[
@@ -228,7 +230,8 @@
228230
"array(varchar)"
229231
],
230232
"variableArity":false
231-
}
233+
},
234+
"builtInFunctionKind": "ENGINE"
232235
},
233236
"arguments":[
234237
{
@@ -258,7 +261,8 @@
258261

259262
],
260263
"variableArity":false
261-
}
264+
},
265+
"builtInFunctionKind": "ENGINE"
262266
},
263267
"returnType":"bigint",
264268
"arguments":[
@@ -282,7 +286,8 @@
282286

283287
],
284288
"variableArity":false
285-
}
289+
},
290+
"builtInFunctionKind": "ENGINE"
286291
},
287292
"arguments":[
288293

@@ -308,7 +313,8 @@
308313
"array(varchar(17))"
309314
],
310315
"variableArity":false
311-
}
316+
},
317+
"builtInFunctionKind": "ENGINE"
312318
},
313319
"returnType":"array(varchar(17))",
314320
"arguments":[
@@ -336,7 +342,8 @@
336342
"array(varchar(17))"
337343
],
338344
"variableArity":false
339-
}
345+
},
346+
"builtInFunctionKind": "ENGINE"
340347
},
341348
"arguments":[
342349
{

presto-native-execution/presto_cpp/main/types/tests/data/ScanAgg.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@
206206
"bigint"
207207
],
208208
"variableArity":false
209-
}
209+
},
210+
"builtInFunctionKind": "ENGINE"
210211
},
211212
"returnType":"bigint",
212213
"arguments":[
@@ -241,7 +242,8 @@
241242
"bigint"
242243
],
243244
"variableArity":false
244-
}
245+
},
246+
"builtInFunctionKind": "ENGINE"
245247
}
246248
}
247249
},

presto-native-execution/presto_cpp/main/types/tests/data/ScanAggBatch.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@
185185
"bigint"
186186
],
187187
"variableArity":false
188-
}
188+
},
189+
"builtInFunctionKind": "ENGINE"
189190
},
190191
"returnType":"bigint",
191192
"arguments":[
@@ -220,7 +221,8 @@
220221
"bigint"
221222
],
222223
"variableArity":false
223-
}
224+
},
225+
"builtInFunctionKind": "ENGINE"
224226
}
225227
}
226228
},

presto-native-execution/presto_cpp/main/types/tests/data/ScanAggCustomConnectorId.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@
152152
"bigint"
153153
],
154154
"variableArity":false
155-
}
155+
},
156+
"builtInFunctionKind": "ENGINE"
156157
},
157158
"returnType":"bigint",
158159
"arguments":[
@@ -187,7 +188,8 @@
187188
"bigint"
188189
],
189190
"variableArity":false
190-
}
191+
},
192+
"builtInFunctionKind": "ENGINE"
191193
}
192194
}
193195
},

0 commit comments

Comments
 (0)