Skip to content

Commit da24afe

Browse files
committed
feat(cubesql): CONCAT function support for SQL push down
1 parent 581faad commit da24afe

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

packages/cubejs-schema-compiler/src/adapter/BaseQuery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2423,6 +2423,7 @@ class BaseQuery {
24232423
AVG: 'AVG({{ args_concat }})',
24242424

24252425
COALESCE: 'COALESCE({{ args_concat }})',
2426+
CONCAT: 'CONCAT({{ args_concat }})',
24262427
},
24272428
statements: {
24282429
select: 'SELECT {{ select_concat | map(attribute=\'aliased\') | join(\', \') }} \n' +

packages/cubejs-schema-compiler/src/adapter/PostgresQuery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export class PostgresQuery extends BaseQuery {
4949
// eslint-disable-next-line no-template-curly-in-string
5050
templates.params.param = '${{ param_index + 1 }}';
5151
templates.functions.DATETRUNC = 'DATE_TRUNC({{ args_concat }})';
52+
templates.functions.CONCAT = 'CONCAT({% for arg in args %}CAST({{arg}} AS TEXT){% if not loop.last %},{% endif %}{% endfor %})';
5253
return templates;
5354
}
5455
}

0 commit comments

Comments
 (0)