Skip to content

Commit

Permalink
Prestissimo ApproxMostFrequent JSON
Browse files Browse the repository at this point in the history
Summary:
X-link: facebookincubator/velox#12189

Prestissimo ApproxMostFrequent is not implemented for JSON. This PR adds support for JSON type.

Differential Revision: D68287956
  • Loading branch information
natashasehgal authored and facebook-github-bot committed Jan 28, 2025
1 parent 510024d commit 724be51
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class FunctionMetadataTest : public ::testing::Test {
};

TEST_F(FunctionMetadataTest, approxMostFrequent) {
testFunction("approx_most_frequent", "ApproxMostFrequent.json", 12);
testFunction("approx_most_frequent", "ApproxMostFrequent.json", 14);
}

TEST_F(FunctionMetadataTest, arrayFrequency) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,26 @@
},
"schema": "default"
},
{
"aggregateMetadata": {
"intermediateType": "row(bigint,bigint,array(json),array(bigint))",
"isOrderSensitive": true
},
"docString": "presto.default.approx_most_frequent",
"functionKind": "AGGREGATE",
"outputType": "map(json,bigint)",
"paramTypes": [
"bigint",
"json",
"bigint"
],
"routineCharacteristics": {
"determinism": "DETERMINISTIC",
"language": "CPP",
"nullCallClause": "CALLED_ON_NULL_INPUT"
},
"schema": "default"
},
{
"aggregateMetadata": {
"intermediateType": "row(bigint,bigint,array(boolean),array(bigint))",
Expand Down Expand Up @@ -239,6 +259,26 @@
"nullCallClause": "CALLED_ON_NULL_INPUT"
},
"schema": "default"
},
{
"aggregateMetadata": {
"intermediateType": "row(bigint,bigint,array(json),array(bigint))",
"isOrderSensitive": true
},
"docString": "presto.default.approx_most_frequent",
"functionKind": "WINDOW",
"outputType": "map(json,bigint)",
"paramTypes": [
"bigint",
"json",
"bigint"
],
"routineCharacteristics": {
"determinism": "DETERMINISTIC",
"language": "CPP",
"nullCallClause": "CALLED_ON_NULL_INPUT"
},
"schema": "default"
}
]
}

0 comments on commit 724be51

Please sign in to comment.