Skip to content

Commit

Permalink
fix(dreamio-driver): Allow casting boolean/number/measure (#2560)
Browse files Browse the repository at this point in the history
  • Loading branch information
ovr committed Apr 14, 2021
1 parent eebb2fa commit 4ff93fe
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/cubejs-dremio-driver/driver/DremioQuery.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ class DremioFilter extends BaseFilter {
likeIgnoreCase(column, not, param) {
return ` ILIKE (${column}${not ? ' NOT' : ''}, CONCAT('%', ${this.allocateParam(param)}, '%'))`;
}

castParameter() {
if (this.definition().type === 'boolean') {
return 'CAST(? AS BOOLEAN)';
} else if (this.measure || this.definition().type === 'number') {
// TODO here can be measure type of string actually
return 'CAST(? AS DOUBLE)';
}

return '?';
}
}

class DremioQuery extends BaseQuery {
Expand Down

0 comments on commit 4ff93fe

Please sign in to comment.