Package org.apache.drill.exec.udfs
Class TimeBucketFunctions.TimestampTimeBucketFunction
java.lang.Object
org.apache.drill.exec.udfs.TimeBucketFunctions.TimestampTimeBucketFunction
- All Implemented Interfaces:
DrillFunc
,DrillSimpleFunc
- Enclosing class:
- TimeBucketFunctions
public static class TimeBucketFunctions.TimestampTimeBucketFunction
extends Object
implements DrillSimpleFunc
This function is used for facilitating time series analysis by creating buckets of time intervals. See
https://blog.timescale.com/blog/simplified-time-series-analytics-using-the-time_bucket-function/ for usage. The function takes two arguments:
1. The timestamp (as a Drill timestamp)
2. The desired bucket interval IN milliseconds
The function returns a BIGINT of the nearest time bucket.
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
TimestampTimeBucketFunction
public TimestampTimeBucketFunction()
-
-
Method Details
-
setup
public void setup()- Specified by:
setup
in interfaceDrillSimpleFunc
-
eval
public void eval()- Specified by:
eval
in interfaceDrillSimpleFunc
-