On this Page
Table of Contents | ||||
---|---|---|---|---|
|
Overview
The Date Time Extractor is a Transform type Snap that is used to extract components from datetime
data and add them to the result field. You can use the Snap to prepare the data before performing aggregation or analysis. For example, to identify the total sales for each month or quarter.
Info |
---|
The Date Time Extractor Snap is an alternative to the |
Expected Input and Output
- Expected input: A document with
datetime
fields. - Expected output: A document with fields that contain
datetime
components. - Expected upstream Snaps: Any Snap that has a document output stream. For example, Mapper, JSON Parser, etc.
- Expected downstream Snaps: Any Snap that has a document input stream. For example, Aggregate, Profile, etc.
Prerequisite
The input document must contain datetime
fields.
Configuring Accounts
Accounts are not used with this Snap.
Configuring Views
Input | This Snap has exactly one document input view. |
---|---|
Output | This Snap has exactly one document output view. |
Error | This Snap has at most one document error view. |
Troubleshooting
None
Limitations and Known Issues
None
Modes
- Ultra Pipelines: Works in Ultra Pipelines.
Snap Settings
Label | Required. The name for the Snap. You can modify this to be specific, especially if you have more than one of the same Snap in your pipeline. | ||
---|---|---|---|
Policy | Specify your preferences for the date time extraction. Each policy contains an input field, component, and the result field. The Snap extracts the date or time component from the input field value and writes it to the result field. | ||
Field | Required. Select the
Default value: None | ||
Component | Choose the component that the Snap must extract from the input field. The available options are:
Default value: Date | ||
Result field | Required. Specify the result field to be used in the output map. If the Result field is the same as Field, the values are overwritten. If the Result field does not exist in the original input document, a new field is added. Default value: None | ||
Snap Execution | Select one of the following three modes in which the Snap executes:
Default Value: Execute only |
Example
Simple Date Time Extraction
This pipeline demonstrates how we can extract date and time components from an input data using the Date Time Extractor Snap.
Download this pipeline.
Expand | ||
---|---|---|
| ||
In this example, the Mapper Snap is used to generate a datetime object. The text 2013-02-01 is parsed into a datetime object using the Date.parse function in the Mapper Snap. The Mapper Snap configuration is as follows: The datetime object generated by the Mapper Snap is as follows: The datetime object from the Mapper Snap is passed to the Date Time Extractor Snap. The Date Time Extractor Snap is configured as follows: The output preview of the Date Time Extractor Snap is as follows: You can see that all the date time components from the input data are extracted. Download this pipeline. |
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|