...
- START: use this expression to set the start time stamp. The result of the expression is interpreted in the same way as using STARTTIMESTAMP in schema creating a new source. The value will be interpreted as basic time unit (e.g. millisecond)
- END: use this expression to set the end time stamp. The result of the expression is interpreted in the same way as using ENDTIMESTAMP in schema creating a new source. The value will be interpreted as basic time unit (e.g. millisecond)
- clearEnd: This parameter can be used to delete the end time stamp (i.e. set to infinity). Attention: If no start attribute is given, the start time stamp will be set to system time, unless the parameter SystemTime is set to false!
- SystemTime: If not start attribute is given, the time stamps will be set to system time (now()). Use SystemTime = 'false' to avoid using system time.
- If the start timestamp is spread over multiple attributes, use the following parameter to set year, month, etc. individually:
- YEAR:
- MONTH:
- DAY:
- HOUR:
- MINUTE:
- SECOND:
- MILLISECOND:
- FACTOR (Integer): Multiply the input value with this factor (e.g. to allow a finer time granularity)
- DATEFORMAT: If set, the start attribute value will be interpreted as date string (Java SimpleDateFormat)
- TIMEZONE (TimeZone): Set the timezone. Will only be used, if YEAR (etc) or DateFormat is set.
- dateformat: If you want to process a timestamp that is based on a string, you will need to assign this timestamp attribute to start and must use dateformat to tell Odysseus in which format the date is represented. See https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html for an explanation of the needed parameters.
Example
PQL
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
/// Example using attributes for timestamp
output = Timestamp({year='year', month='month', day='day', hour='hour', minute='minute', second='second', millisecond='millisecond'}, input)
/// Example using date format
output = Timestamp({start='timestamp', dateformat='EEE MMM dd HH:mm:ss zzz yyyy'}, input)
/// Example with german time stamps
output = Timestamp({start='timestamp',dateformat = 'dd.MM.yyyy HH:mm:ss'}, input)
/// Simulate an Expression based window:
output = Timestamp({start='start', end = 'start+1000'},input)
/// Create windows starting at distinct points in time, e.g. a "month"-based window (where the input attribute timestamp is a String based date representation):
ouput = TIMESTAMP({START = 'toLong(monthStart(toDate(timestamp,"dd.MM.yyyy")))',
END = 'toLong(nextMonthStart(toDate(timestamp,"dd.MM.yyyy")))'},input) |
...