-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
1.xarea/influxqlIssues related to InfluxQL query languageIssues related to InfluxQL query languagekind/feature
Description
Apache Datafusion, the query engine that powers Influx v3, supports the following function: https://datafusion.apache.org/user-guide/sql/scalar_functions.html#date-part
Please implement date_part within influxql.
date_part(part, expression)
Arguments
- part: Part of the date to return. The following date parts are supported:
- year
- quarter (emits value in inclusive range [1, 4] based on which quartile of the year the date is in)
- month
- week (week of the year)
- day (day of the month)
- hour
- minute
- second
- millisecond
- microsecond
- nanosecond
- dow (day of the week where Sunday is 0)
- doy (day of the year)
- epoch (seconds since Unix epoch)
- isodow (day of the week where Monday is 0)
- expression: Time expression to operate on. Can be a constant, column, or function.
Example usage:
SELECT * FROM some_measurement
WHERE time >= now() - 10d AND time <= now() AND (date_part(time, dow) != 0 AND date_part(time, dow) != 6)
Metadata
Metadata
Assignees
Labels
1.xarea/influxqlIssues related to InfluxQL query languageIssues related to InfluxQL query languagekind/feature