Skip to content

Commit f458c7c

Browse files
committed
Update the likeIgnoreCase method for the druid driver
1 parent b9a4d83 commit f458c7c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/cubejs-druid-driver/src/DruidQuery.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ class DruidFilter extends BaseFilter {
1616
public likeIgnoreCase(column, not, param, type: string) {
1717
const p = (!type || type === 'contains' || type === 'ends') ? '%' : '';
1818
const s = (!type || type === 'contains' || type === 'starts') ? '%' : '';
19-
return `${column}${not ? ' NOT' : ''} LIKE CONCAT('${p}', ${this.allocateParam(param)}, '${s}')`;
19+
return `LOWER(${column})${not ? ' NOT' : ''} LIKE CONCAT('${p}', LOWER(${this.allocateParam(param)}), '${s}')`;
2020
}
21+
2122
}
2223

2324
export class DruidQuery extends BaseQuery {
2425
public newFilter(filter) {
2526
return new DruidFilter(this, filter);
2627
}
27-
28+
2829
public timeGroupedColumn(granularity: string, dimension: string) {
2930
return GRANULARITY_TO_INTERVAL[granularity](dimension);
3031
}

0 commit comments

Comments
 (0)