Hello, I’m trying to use the new LIKE operator, bu...
# troubleshooting
e
Hello, I’m trying to use the new LIKE operator, but it seems that the
NOT LIKE
doesn’t work, do you know why? i.e. I’m having results with
Copy code
select * from datasource_61c064dc1c9900030074e5f3 where JSONEXTRACTSCALAR("labels", '$.locale', 'STRING') LIKE '%fr_FR%' limit 10
but 0 results with
Copy code
select * from datasource_61c064dc1c9900030074e5f3 where JSONEXTRACTSCALAR("labels", '$.locale', 'STRING') NOT LIKE '%en_US%' limit 10
where labels is
Copy code
{
  "locale": "fr_FR",
  "brand": "undiz"
}
Thank you
a
There is no NOT LIKE syntax support in Pinot. Please do WHERE NOT (a LIKE b)
e
Copy code
SELECT * FROM datasource_61c08221384b0003008bbc49 WHERE NOT (JSONEXTRACTSCALAR("labels", '$.locale', 'STRING') LIKE '%en_US%') LIMIT 0,100
Returns
Copy code
ProcessingException(errorCode:150, message:PQLParsingError:
org.apache.pinot.sql.parsers.SqlCompilationException: Unsupported filter kind: NOT
	at org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter.updateComparisonPredicate(PredicateComparisonRewriter.java:58)
	at org.apache.pinot.sql.parsers.rewriter.PredicateComparisonRewriter.rewrite(PredicateComparisonRewriter.java:37)
	at org.apache.pinot.sql.parsers.CalciteSqlParser.queryRewrite(CalciteSqlParser.java:373)
	at org.apache.pinot.sql.parsers.CalciteSqlParser.compileCalciteSqlToPinotQuery(CalciteSqlParser.java:367))
a
Oh yeah, sorry. I forgot we don't support NOT operator
e
Ah, so the only way is to use REGEXP_LIKE right? Do you plan to support NOT LIKE?
a
I am going to work on the NOT operator support soon, so should work. Can you open a ticket for NOT LIKE and tag me?
e
yep thank you
a
Yeah, I am working on it. I am curious though, how do you so a NOT with REGEXP_LIKE? Pinot doesn't support NOT operator in general, not specific to LIKE
e
with something like this https://stackoverflow.com/a/406408
a
Ah, so you are reversing the regexp itself.
e
Yep it’s the only way I’ve found
a
Give me a week and you will have not operator supported
e
awesome, thank you
m
Thanks @Atri Sharma