Skip to content

Commit

Permalink
Merge pull request duckdb#9613 from renevdzee/add-listagg
Browse files Browse the repository at this point in the history
Add SQL:2016 listagg
  • Loading branch information
Mytherin authored Nov 9, 2023
2 parents ed80e70 + b83ae35 commit b5a294e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core_functions/aggregate/distributive/functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
"description": "Concatenates the column string values with an optional separator.",
"example": "string_agg(A, '-')",
"type": "aggregate_function_set",
"aliases": ["group_concat"]
"aliases": ["group_concat","listagg"]
},
{
"name": "sum",
Expand Down
1 change: 1 addition & 0 deletions src/core_functions/function_list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ static StaticFunctionDefinition internal_functions[] = {
DUCKDB_SCALAR_FUNCTION(ListTransformFun),
DUCKDB_SCALAR_FUNCTION(ListUniqueFun),
DUCKDB_SCALAR_FUNCTION(ListValueFun),
DUCKDB_AGGREGATE_FUNCTION_SET_ALIAS(ListaggFun),
DUCKDB_SCALAR_FUNCTION(LnFun),
DUCKDB_SCALAR_FUNCTION_ALIAS(LogFun),
DUCKDB_SCALAR_FUNCTION(Log10Fun),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ struct GroupConcatFun {
static constexpr const char *Name = "group_concat";
};

struct ListaggFun {
using ALIAS = StringAggFun;

static constexpr const char *Name = "listagg";
};

struct SumFun {
static constexpr const char *Name = "sum";
static constexpr const char *Parameters = "arg";
Expand Down

0 comments on commit b5a294e

Please sign in to comment.