Can we have IN filter?
Hi! Great job for InfluxDB.
And I wonder If it can support IN filter in where clause, so far it seems no supported:
SELECT * FROM mydb WHERE service IN ('aa', 'bb');
{
"error": "error parsing query: found IN, expected SELECT, DELETE, SHOW, CREATE, DROP, GRANT, REVOKE, ALTER at line 1, char 321"
}
version: bdd469db26c483a0acdcadbb937829a3913d9be5
We don't have support for IN right now but you can use OR, for the query you provided:
SELECT * from mydb WHERE service = 'aa' OR service = 'bb'
I too would like this, and it should be easy with some query re-writing of the AST. Let me see if I can get to it.
A potentially easier workaround than multiple OR statements would be to use a regex. I think it should be faster, too. E.g.
SELECT * from mydb WHERE service =~ /aa|bb/
That said, supporting IN would be great, especially for greater congruence with SQL.
+1
Hi Guys,
Is this feature request still valid? If it is valid, can I work on this task?
Thanks
Yes, we are still interested in this feature.
Thanks, I will start working on this during weekend.
We have another usecase, the support for IN would make it possible to integrate Grafana's multiselect feature with influx
@ch33hau do you have any update?
Hi @kalidasya sorry I was stop it half way, will working on it sooner.
However, I found that IN already exists in influxdb for other purpose. Due to the way we code, might not able to use IN for the purpose of this issue.
Is it possible to rename it to other syntax, eg, WITHIN?
@ch33hau good to hear, WITHIN to me more time related but I also cannot really come up with anything better
@ch33hau any updates on this?
This would be great guys! It's been a few years but ???
Please implement this faster, this feature is very very mich needed
Is anybody working on this? I was thinking of taking a crack at this tomorrow
There is nobody currently working on this at the moment. Feel free to give it a try.
+1
I would love this feature
+1
this feature any update?
Looking forward to this. I would be fine using the WHERE .. OR or regex alternatives, but even won't work when the list of values passed to IN is very large (20k plus). Right now I don't see such a way to process this data without causing a "url too large" error.