How can I use ILIKE? I have this, but it fails ```...
# support
r
How can I use ILIKE? I have this, but it fails
Copy code
AND stringTagMap['service.name'] ilike '%{{.environment}}'
Using the variable is not working properly. If I use
%production
the query works
s
I don’t think you need single quotes around. What error does it show?
r
400 error
Without quotes
AND stringTagMap['service.name'] ilike %{{.environment}}
Copy code
Error: API responded with 400 - encountered multiple errors: error in query-A: code: 62, message: Syntax error: failed at position 394 ('%') (line 8, col 46): %<no value> GROUP BY op_name, interval ORDER BY op_name ASC, interval. Expected one of: ANY, ALL, BETWEEN expression, string concatenation expression, list, delimited by operator of variable arity, additive expression, list, delimited by binary operators, INTERVAL operator expression, INTERVAL, TIMESTAMP operator expression, TIMESTAMP, DATE operator expression, DATE, multiplicative expression, unary expression, expression with prefix unary operator, NOT, CAST expression, tuple element expression, array element expression, element of expression, SELECT subquery, CAST operator, tuple, collection of literals, parenthesized expression, array, literal, NULL, number, Bool, true, false, string literal, case, CASE, COLUMNS matcher, COLUMNS, function, identifier, qualified asterisk, compound identifier, list of elements, asterisk, substitution, MySQL-style global variable
With quotes
AND stringTagMap['service.name'] ilike '%{{.environment}}'
Copy code
Error: API responded with 400 - encountered multiple errors: error in query-A: code: 62, message: Syntax error: failed at position 397 ('production') (line 8, col 49): production'' GROUP BY op_name, interval ORDER BY op_name ASC, interval. Expected one of: token, DoubleColon, MOD, DIV, NOT, BETWEEN, LIKE, ILIKE, NOT LIKE, NOT ILIKE, IN, NOT IN, GLOBAL IN, GLOBAL NOT IN, IS, AND, OR, QuestionMark, alias, AS, GROUP BY, WITH, HAVING, WINDOW, ORDER BY, LIMIT, OFFSET, SETTINGS, UNION, EXCEPT, INTERSECT, INTO OUTFILE, FORMAT, end of query
@Srikanth Chekuri 👀
s
Can you share the full query?