Skip to content

Commit

Permalink
Druid lower argument fix (#3723)
Browse files Browse the repository at this point in the history
Co-authored-by: Egor Ryashin <[email protected]>
  • Loading branch information
egor-ryashin and Egor Ryashin authored Dec 19, 2023
1 parent 085a382 commit e19116c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions runtime/queries/metricsview.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ func buildFilterClauseForCondition(mv *runtimev1.MetricsViewSpec, cond *runtimev
} else {
if dialect == drivers.DialectDruid {
// Druid does not support ILIKE
clause = fmt.Sprintf("LOWER(%s) %s LIKE LOWER(?)", name, notKeyword)
clause = fmt.Sprintf("LOWER(%s) %s LIKE LOWER(CAST(? AS VARCHAR))", name, notKeyword)
} else {
clause = fmt.Sprintf("%s %s ILIKE ?", name, notKeyword)
}
Expand Down Expand Up @@ -425,7 +425,7 @@ func buildLikeExpression(mv *runtimev1.MetricsViewSpec, cond *runtimev1.Conditio
} else {
if dialect == drivers.DialectDruid {
// Druid does not support ILIKE
clause = fmt.Sprintf("LOWER(%s) %s LIKE LOWER(%s)", leftExpr, notKeyword, rightExpr)
clause = fmt.Sprintf("LOWER(%s) %s LIKE LOWER(CAST(%s AS VARCHAR))", leftExpr, notKeyword, rightExpr)
} else {
clause = fmt.Sprintf("%s %s ILIKE %s", leftExpr, notKeyword, rightExpr)
}
Expand Down

0 comments on commit e19116c

Please sign in to comment.