Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support aggregate function FIRST #555

Closed
yukkit opened this issue Aug 20, 2022 · 0 comments
Closed

[Feature] Support aggregate function FIRST #555

yukkit opened this issue Aug 20, 2022 · 0 comments
Assignees
Labels
component/function component/query documentation Improvements or additions to documentation good first issue Good for newcomers
Milestone

Comments

@yukkit
Copy link
Contributor

yukkit commented Aug 20, 2022

Is your feature request related to a problem? Please describe.
Returns the field value with the oldest timestamp.

Describe the solution you'd like

  • Syntax
--- Returns the oldest colume value (determined by timestamp) associated with the colume name.
FIRST(<time colume>, <colume name>): <colume value>
  • arguments
time colume: ......
colume name: Any fields or tags
  • returns
colume value: the oldest colume value, The data type is consistent with the specified column

Describe alternatives you've considered

Add to the https://github.com/cnosdb/cnosdb/tree/main/query_server/query/src/extension/expr/aggregate_function

Additional context

The mainstream database supports FIRST show below:

timescaledb
https://docs.timescale.com/api/latest/hyperfunctions/first/

InfluxDB
https://docs.influxdata.com/enterprise_influxdb/v1.9/query_language/functions/#first

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/function component/query documentation Improvements or additions to documentation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants