influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
28.93k stars 3.55k forks source link

[[feature collection]] requested Functions and query operators #5930

Open beckettsean opened 8 years ago

beckettsean commented 8 years ago

This issue contains a list of related feature requests that are not on the near-term roadmap. The feature requests in this issue are all new functions that have been requested. If you want to request a function not already listed please make a comment on this issue, and we will add it to the checklist.

Aggregations

dgomes commented 7 years ago

@pgeiger why not follow "trapezoidal numerical integration" such as the one found in MatLab and Python's SciPy ?

pgeiger-xx commented 7 years ago

@dgomes - I'll check it out, thanks.

gwuillou commented 7 years ago

Hello,

Is it possible to add the function abs: select abs("value") from ... ?

If not. Why is it so complicated? There is already the mean, max, min, derivative... which are more complicated as function!

If yes. when do you plan to add this feature?

Thank you!

janpaulus commented 7 years ago

We are waiting for #1115. Right now we have to calculate the average of series with odd time interval in our application. This is really problematic if the series has lots of point which have to be pushed over the network.

voiprodrigo commented 7 years ago

+1 for "Top accepts nested functions". Really missing a top(sum()) atm.

Thanks for the great work!

Tomcat-Engineering commented 7 years ago

@pgeiger There is already a pull request for an integral function, we are just discussing what to call it! Feel free to get involved in the discussion.

Tomcat-Engineering commented 7 years ago

@gwuillou Adding the abs() function to work as SELECT abs(value) FROM data is indeed simple. I have an example of this (along with about ten other functions) working in my repo.

Unfortunately the InfluxQL parser and query code is very complicated, so it turns out that it is really hard to make statements like the following work as users will expect:

SELECT value, abs(value) FROM data
SELECT max(value), abs(value) FROM data

Until I figure out how to make these things work properly, I doubt I will get the new functions accepted into the InfluxDB codebase.

darrynv commented 7 years ago

+1 wish point to histogram()

dstreppa commented 7 years ago

+1 for Integral()

joaquin386 commented 7 years ago

+1 to #142. InfluxDB needs timeshift as Graphite currently has. The monitoring should have some reference so 1 day back, 7 days back information should be possible to be added to the grap (timeshift)

jsternberg commented 7 years ago

Marking a few of these as done since they are possible using subqueries as shown in #8402.

ghost commented 7 years ago

+1 for timeShift, critical analytic function

gkorzhuk commented 7 years ago

+1 for time shift

seryoni commented 7 years ago

+1 wish point to histogram()

calder commented 7 years ago

+1 wish point for histogram()

This is pretty crucial for us, and is really a "killer feature" for any timeseries database.

juris commented 7 years ago

+1 for timeShift. It's been 4 years since feature request #142

AlainPilon commented 7 years ago

+1 for Harmonic and Geometric

mozaroc commented 7 years ago

+1 for exponents and logarithms #659

JariInc commented 6 years ago

+1 for exponents and logarithms #659

AsyDemo commented 6 years ago

+1 for histogram #3674

sugartechllc commented 6 years ago

+1 for exponents and logarithms #659

tyldum commented 6 years ago

+1 for trigonometric functions (cosine)

Brausmith commented 6 years ago

+1 for Histogram, the only other feature I need at the moment.

galindro commented 6 years ago

+1 for https://github.com/influxdata/influxdb/issues/6723

jkschneider commented 6 years ago

+1 for Histogram.

voiprodrigo commented 6 years ago

+1 for Timeshift!

sampower06 commented 6 years ago

+1 for TimeShift!

yuanhuanglin commented 6 years ago

+1 wish point to histogram()

arturom commented 6 years ago

I'd like to request for a new summary function specifically made for time series visualization: Largest-Triangle-Three-Buckets.

I've been using mean to downsample data, but averaging time series data results in a smooth line which does not accurately represents the underlying data.

Sveinn Steinarsson wrote a thesis titled "Downsampling Time Series for Visual Representation" that describes and tests algorithms for that purpose. The d3fc library makes use of "Largest-Triangle-Three-Buckets" in the front end, but it would be best if InfluxDB could downsample the data to transmit and process as few bytes as possible.

tecmatia-dp commented 6 years ago

We are new to InfluxDB, but we are betting on using it, because it is robust and efficient. Congratulations and thank you for that. However, there are some incomprehensible lacks for a TSDB, such as the time-weighted average, return of the previous value at the initial time of the query... In short, improve the support for data recorded by variation. So +1 for #3633 and #7445.

tecmatia-dp commented 6 years ago

Boolean type cast #7562 seems easy to solve, and very important for use with Grafana for example, which does not support well the use of boolean.

nikodc commented 6 years ago

+1 wish point to histogram()

makefu commented 6 years ago

+1 for time shift

sidgod commented 6 years ago

+1 for histogram()

charlottetucker commented 6 years ago

+1 for CAST function. Seriously, why isn't this a thing?

AnnapoorniS commented 6 years ago

Is user defined function feature available in influx db? It will of great help if somebody could help me with sample in influxdb, which are similar to stored procedures. Any suggestions? Thanks in advance.

timhallinflux commented 6 years ago

@AnnapoorniS I'd suggest looking at Flux https://github.com/influxdata/platform/tree/master/query

henriklb commented 6 years ago

Assuming that because #834 is checked it is seen as completed.

These functions does still not work (v.1.5.1) and would very be useful for me: sum(non_negative_derivative(value)) sum(derivative(value))

Thanks

balakrishnabk commented 6 years ago

aggregation with respect to weekday and weeknumber based on the timestamp

matthenning commented 6 years ago

Does #3552 fit in here?

MarcoPignati commented 6 years ago

+1 for histogram #3674

mrungue commented 5 years ago

I'd like to request for a new summary function specifically made for time series visualization: Largest-Triangle-Three-Buckets.

I've been using mean to downsample data, but averaging time series data results in a smooth line which does not accurately represents the underlying data.

Sveinn Steinarsson wrote a thesis titled "Downsampling Time Series for Visual Representation" that describes and tests algorithms for that purpose. The d3fc library makes use of "Largest-Triangle-Three-Buckets" in the front end, but it would be best if InfluxDB could downsample the data to transmit and process as few bytes as possible.

+1

n1nj4888 commented 5 years ago

👍 +1 for timeshift functions - Seems like this has been requested multiple times by a number of users

sfitts commented 5 years ago

The checklist implies that both "percentile + derivative" (#5150) and "Top accepts nested functions" (#2467, #5345) are addressed. However, the documentation says that neither percentile nor top supports nested functions (as of 1.7). So... is the checklist wrong? Can you do these without nested function support? Is the doc wrong?

timhallinflux commented 5 years ago

Hey @sfitts! (from the Forte days?!?) ... I believe you can do these now with subqueries. So, while it's not a direct nesting, it can be done that way. The primary focus going forward in terms of extending the query surface area is going to be done via Flux. https://docs.influxdata.com/flux/v0.7/

InfluxQL will, of course, continue to be supported. But there are challenges that we are going to address at the query engine layer and then open up the ability to address so many of these requests via Flux. Have a look, let us know!

sfitts commented 5 years ago

@timhallinflux just after I wrote this it dawned on me that subqueries were probably the answer -- thanks for the confirmation. Also hadn't picked up on the fact that a query language replacement was in the works, so I'll definitely check that out.

(and yep -- I date back to Forte 👍)

timhallinflux commented 5 years ago

Good to reconnect! I want to be super clear.... we are not going to "replace" InfluxQL. As we continue forward, InfluxQL will continue to be the primary on-ramp and supported. But, in terms of working with time series data -- we determined that a functional language can be a powerful way to manipulate the functions, results, and simplify developer code (in the end). So many of these requests were part of our design center for Flux itself and ensuring that we can deliver on them. We have been listening, observing, and attempting to address many of these for multiple years now. We started and failed at least twice...a couple of attempts that never saw the light of day and weren't "ship worthy".

With Flux, we are on the brink of breaking through and delivering on this list (and more!) while continuing to support InfluxQL. i.e. Histogram...already in. So, we maintain the easy on-ramp via InfluxQ. If that is all you need...great! But, if you need more power...and there are a number of time series use cases which certainly do -- particularly given this list, Flux will be there. In 1.7 InfluxDB, there are two query engines that run in parallel. In 2.0, the Flux engine will be the primary engine and InfluxQL will run in a compatibility mode on top of that engine. Hope that helps clarify!

sfitts commented 5 years ago

Makes sense (and thanks for the clarification).

tecmatia-dp commented 5 years ago

3 years and Boolean cast to Integer (1/0) is not yet implemented...

uski commented 5 years ago

Thank you for the hard work. I just came here to express that more functions would definitely be very useful. I am currently held back by the lack of logarithmic mean aggregator and I believe the query language is not flexible enough to allow me to do it from the query itself.

So, +1 for log mean please !