Hi folks! I seem to have found a bug, but I'd like...
# troubleshooting
d
Hi folks! I seem to have found a bug, but I'd like to confirm here first, and if it does look like a bug I'll open a ticket on GitHub - I just want to check whether I'm doing anything wrong.
The bug is, essentially, that a query with
where some_column like 'some-value%'
behaves exactly the same as
where some_column not like 'some-value%'
- that is, the negation in the
like
constraint is basically doing nothing
This is a reference query, for example, just to show that there's more data later:
Now, check out this query, which is working like it's supposed to:
a
Nah, it's not a bug. Pinot does not support NOT operator - so essentially the NOT will not do anything
Ideally we should be chucking an exception when somebody used NOT with LIKE - I will add that check
d
Oh... but how about
IS NOT NULL
then?
Ahhh, because
IS NOT NULL
is a single expression, then?
a
Is not null is a constraint type on single value (we support that). NOT operator is an entire predicate
Correct
d
(Just to complete my findings, here's it not working like I was expecting:)
a
Yeah, that's not surprising. It basically is getting planned like a LIKE query
d
Ah, ok then, got it. And do you know whether it's possible to filter while negating a LIKE clause?
a
How would you do that? We don't support NOT at all today. You could use REGEXP_LIKE and invert the relevant regex yourself
d
Ah, got it! Alright, sounds good enough for me 🙂
Thanks @Atri Sharma!
a
Here is what I can do - I can hack up the support for NOT LIKE this weekend and then it will be released as a part of the next release
Would that work for you? Ideally, nobody should be latching anymore to REGEXP_LIKE because we plan on deprecating that (with the advent of LIKE operator)
j
wait are you sure this is normal?
NOT IN
seems to work fine?
d
Oh, man, on a Christmas week? I don't have the courage to ask you that 😄 But something like that will be useful at some point for us, for sure, though maybe not initially - I'm still getting around what queries exactly we're going to do
a
Again, NOT IN is a single expression. NOT is a predicate level operation.
OK, I will get NOT LIKE done this week.
@Diogo Baeder if you are playing around with Pinot at the moment, anything is fine. My only ask is not to take a dependency on REGEXP_LIKE in production, when LIKE is supported
j
ah ok, ty for the explanation!
d
Thanks a lot man! ❤️
j
out of curiosity, is there another example with “NOT” where it’s a predicate level operation rather than part of the expression