Skip to content

Commit 893e9b3

Browse files
authored
fix(cubesql): Improve SQL push down for Athena/Presto (#9873)
1 parent c9ee201 commit 893e9b3

File tree

5 files changed

+413
-62
lines changed

5 files changed

+413
-62
lines changed

packages/cubejs-schema-compiler/src/adapter/PrestodbQuery.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,8 @@ export class PrestodbQuery extends BaseQuery {
157157
templates.expressions.timestamp_literal = 'from_iso8601_timestamp(\'{{ value }}\')';
158158
// Presto requires concat types to be VARCHAR
159159
templates.expressions.binary = '{% if op == \'||\' %}' +
160-
'CAST({{ left }} AS VARCHAR) || CAST({{ right }} AS VARCHAR)' +
161-
'{% else %}{{ left }} {{ op }} {{ right }}{% endif %}';
160+
'(CAST({{ left }} AS VARCHAR) || CAST({{ right }} AS VARCHAR))' +
161+
'{% else %}({{ left }} {{ op }} {{ right }}){% endif %}';
162162
delete templates.expressions.ilike;
163163
templates.types.string = 'VARCHAR';
164164
templates.types.float = 'REAL';

0 commit comments

Comments
 (0)