Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ public class BuiltInFunctionHandle
private final Signature signature;
private final BuiltInFunctionKind builtInFunctionKind;

@JsonCreator
public BuiltInFunctionHandle(@JsonProperty("signature") Signature signature)
public BuiltInFunctionHandle(Signature signature)
{
this(signature, ENGINE);
}

public BuiltInFunctionHandle(Signature signature, BuiltInFunctionKind builtInFunctionKind)
@JsonCreator
public BuiltInFunctionHandle(@JsonProperty("signature") Signature signature, @JsonProperty("builtInFunctionKind") BuiltInFunctionKind builtInFunctionKind)
{
this.signature = requireNonNull(signature, "signature is null");
checkArgument(signature.getTypeVariableConstraints().isEmpty(), "%s has unbound type parameters", signature);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ TEST_F(PrestoToVeloxQueryPlanTest, parseIndexJoinNode) {
"returnType": "boolean",
"typeVariableConstraints": [],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType": "boolean"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class RowExpressionTest : public ::testing::Test {
returnTypeField + R"##(,
"typeVariableConstraints": [],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
)##" +
returnTypeField + R"##(
Expand Down Expand Up @@ -477,7 +478,8 @@ TEST_F(RowExpressionTest, call) {
"returnType": "boolean",
"typeVariableConstraints": [],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType": "boolean"
}
Expand Down Expand Up @@ -686,7 +688,8 @@ TEST_F(RowExpressionTest, special) {
"returnType": "boolean",
"typeVariableConstraints": [],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType": "boolean"
},
Expand Down Expand Up @@ -718,7 +721,8 @@ TEST_F(RowExpressionTest, special) {
"returnType": "boolean",
"typeVariableConstraints": [],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType": "boolean"
}
Expand Down Expand Up @@ -821,7 +825,8 @@ TEST_F(RowExpressionTest, bind) {
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand All @@ -844,7 +849,8 @@ TEST_F(RowExpressionTest, bind) {
"integer"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand Down Expand Up @@ -894,7 +900,8 @@ TEST_F(RowExpressionTest, likeSimple) {
"returnType" : "boolean",
"argumentTypes" : [ "varchar", "LikePattern" ],
"variableArity" : false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType" : "boolean",
"arguments" : [ {
Expand All @@ -914,7 +921,8 @@ TEST_F(RowExpressionTest, likeSimple) {
"returnType" : "LikePattern",
"argumentTypes" : [ "varchar" ],
"variableArity" : false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType" : "LikePattern",
"arguments" : [ {
Expand Down Expand Up @@ -953,7 +961,8 @@ TEST_F(RowExpressionTest, likeWithEscape) {
"returnType" : "boolean",
"argumentTypes" : [ "varchar", "LikePattern" ],
"variableArity" : false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType" : "boolean",
"arguments" : [ {
Expand All @@ -973,7 +982,8 @@ TEST_F(RowExpressionTest, likeWithEscape) {
"returnType" : "LikePattern",
"argumentTypes" : [ "varchar", "varchar" ],
"variableArity" : false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType" : "LikePattern",
"arguments" : [ {
Expand Down Expand Up @@ -1029,7 +1039,8 @@ TEST_F(RowExpressionTest, dereference) {
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"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))",
"arguments":[
Expand All @@ -1053,7 +1064,8 @@ TEST_F(RowExpressionTest, dereference) {
"integer"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"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)))",
"arguments":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand Down Expand Up @@ -157,7 +158,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"boolean",
"arguments":[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@
"map(varchar,bigint)"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"array(varchar)",
"arguments":[
Expand Down Expand Up @@ -200,7 +201,8 @@
"array(varchar)"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"array(varchar)",
"arguments":[
Expand Down Expand Up @@ -228,7 +230,8 @@
"array(varchar)"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"arguments":[
{
Expand Down Expand Up @@ -258,7 +261,8 @@

],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand All @@ -282,7 +286,8 @@

],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"arguments":[

Expand All @@ -308,7 +313,8 @@
"array(varchar(17))"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"array(varchar(17))",
"arguments":[
Expand Down Expand Up @@ -336,7 +342,8 @@
"array(varchar(17))"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"arguments":[
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand Down Expand Up @@ -241,7 +242,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand Down Expand Up @@ -220,7 +221,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType":"bigint",
"arguments":[
Expand Down Expand Up @@ -187,7 +188,8 @@
"bigint"
],
"variableArity":false
}
},
"builtInFunctionKind": "ENGINE"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@
"integer"
],
"variableArity": false
}
},
"builtInFunctionKind": "ENGINE"
},
"returnType": "boolean",
"arguments": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,9 @@ namespace facebook::presto::protocol::hive {

// NOLINTNEXTLINE: cppcoreguidelines-avoid-c-arrays
static const std::pair<BucketFunctionType, json>
BucketFunctionType_enum_table[] =
{ // NOLINT: cert-err58-cpp
{BucketFunctionType::HIVE_COMPATIBLE, "HIVE_COMPATIBLE"},
{BucketFunctionType::PRESTO_NATIVE, "PRESTO_NATIVE"}};
BucketFunctionType_enum_table[] = { // NOLINT: cert-err58-cpp
{BucketFunctionType::HIVE_COMPATIBLE, "HIVE_COMPATIBLE"},
{BucketFunctionType::PRESTO_NATIVE, "PRESTO_NATIVE"}};
void to_json(json& j, const BucketFunctionType& e) {
static_assert(
std::is_enum<BucketFunctionType>::value,
Expand Down Expand Up @@ -599,13 +598,12 @@ namespace facebook::presto::protocol::hive {

// NOLINTNEXTLINE: cppcoreguidelines-avoid-c-arrays
static const std::pair<HiveCompressionCodec, json>
HiveCompressionCodec_enum_table[] =
{ // NOLINT: cert-err58-cpp
{HiveCompressionCodec::NONE, "NONE"},
{HiveCompressionCodec::SNAPPY, "SNAPPY"},
{HiveCompressionCodec::GZIP, "GZIP"},
{HiveCompressionCodec::LZ4, "LZ4"},
{HiveCompressionCodec::ZSTD, "ZSTD"}};
HiveCompressionCodec_enum_table[] = { // NOLINT: cert-err58-cpp
{HiveCompressionCodec::NONE, "NONE"},
{HiveCompressionCodec::SNAPPY, "SNAPPY"},
{HiveCompressionCodec::GZIP, "GZIP"},
{HiveCompressionCodec::LZ4, "LZ4"},
{HiveCompressionCodec::ZSTD, "ZSTD"}};
void to_json(json& j, const HiveCompressionCodec& e) {
static_assert(
std::is_enum<HiveCompressionCodec>::value,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,11 @@ namespace facebook::presto::protocol::iceberg {

// NOLINTNEXTLINE: cppcoreguidelines-avoid-c-arrays
static const std::pair<ChangelogOperation, json>
ChangelogOperation_enum_table[] =
{ // NOLINT: cert-err58-cpp
{ChangelogOperation::INSERT, "INSERT"},
{ChangelogOperation::DELETE, "DELETE"},
{ChangelogOperation::UPDATE_BEFORE, "UPDATE_BEFORE"},
{ChangelogOperation::UPDATE_AFTER, "UPDATE_AFTER"}};
ChangelogOperation_enum_table[] = { // NOLINT: cert-err58-cpp
{ChangelogOperation::INSERT, "INSERT"},
{ChangelogOperation::DELETE, "DELETE"},
{ChangelogOperation::UPDATE_BEFORE, "UPDATE_BEFORE"},
{ChangelogOperation::UPDATE_AFTER, "UPDATE_AFTER"}};
void to_json(json& j, const ChangelogOperation& e) {
static_assert(
std::is_enum<ChangelogOperation>::value,
Expand Down Expand Up @@ -509,15 +508,14 @@ namespace facebook::presto::protocol::iceberg {

// NOLINTNEXTLINE: cppcoreguidelines-avoid-c-arrays
static const std::pair<PartitionTransformType, json>
PartitionTransformType_enum_table[] =
{ // NOLINT: cert-err58-cpp
{PartitionTransformType::IDENTITY, "IDENTITY"},
{PartitionTransformType::YEAR, "YEAR"},
{PartitionTransformType::MONTH, "MONTH"},
{PartitionTransformType::DAY, "DAY"},
{PartitionTransformType::HOUR, "HOUR"},
{PartitionTransformType::BUCKET, "BUCKET"},
{PartitionTransformType::TRUNCATE, "TRUNCATE"}};
PartitionTransformType_enum_table[] = { // NOLINT: cert-err58-cpp
{PartitionTransformType::IDENTITY, "IDENTITY"},
{PartitionTransformType::YEAR, "YEAR"},
{PartitionTransformType::MONTH, "MONTH"},
{PartitionTransformType::DAY, "DAY"},
{PartitionTransformType::HOUR, "HOUR"},
{PartitionTransformType::BUCKET, "BUCKET"},
{PartitionTransformType::TRUNCATE, "TRUNCATE"}};
void to_json(json& j, const PartitionTransformType& e) {
static_assert(
std::is_enum<PartitionTransformType>::value,
Expand Down
Loading
Loading