juttle / juttle-opentsdb-adapter

Apache License 2.0
1 stars 2 forks source link

Supporting only AND and = in read filter expressions is too limiting #13

Open dmehra opened 8 years ago

dmehra commented 8 years ago

What's the reason we can only support AND, and not OR and NOT? I particularly lament the absence of NOT as you commonly want to take out data for, say, a temp partition, or test host, etc.

juttle> read opentsdb -from :2016-01-01: -name "df.bytes.used" host = 'f5796f87a78f' NOT mount = '/etc/hosts' | head 2
<input>:1:1: 
   1:read opentsdb -from :2016-01-01: -name "df.bytes.used" host = 'f5796f87a78f' NOT mount = '/etc/hosts' | head 2
     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: Only AND and '=' operators with string values are supported in the optimized filter expression. (RT-TYPE-ERROR)

While we're at it, why can't we support != in addition to =?

Can we handle nullness check? read opentsdb ... host = null or host != null?

Can we do any optimized read filter on numeric values, such as read opentsdb ... value > 1000, or is OpenTSDB not giving us a way to do this? (Filing a separate issue on value = number as there's a bug with that).

Can we handle fieldname in ['v1', 'v2'] array inclusion?

Can we handle glob match or regex match on string fields?

For any of the above that is doable and just not done yet, let's file separate issues to track future work.

VladVega commented 8 years ago

We'll be able to do a lot more filtering once a stable version of this becomes available: http://opentsdb.net/docs/build/html/user_guide/query/filters.html

Until then we are stuck with AND and =