EXTRACT
Extracts a unit of time as a field from the given timestamp.
Syntax
Arguments
FIELD
FIELD
Type: identifier
The unit of time to extract.
The following fields are supported:
Field | Description |
---|---|
| year |
| quarter |
| month |
| week |
| day |
| day |
| day of week |
| day of week |
| day of year |
| day of year |
| year of week |
| year of week |
| hour |
| minute |
| second |
X
X
Type: timestamp
The time to extract FIELD
from.
Returns
Type: bigint
The FIELD
extracted from X
.
Examples
Field | X | Output |
---|---|---|
year |
| 2012 |
month |
| 02 |
day |
| 22 |
hour |
| 01 |
minute |
| 02 |
second |
| 21 |
dow |
| 3 |
dow |
|
|
Transformation job example
SQL
Query result
$event_timestamp | event_doy |
---|---|
2022-08-19 20:46:00.000 | 231 |
Last updated