Compose Datetime
Combines parts of a timestamp from existing columns into a new timestamp column.
For example: when combining the columns bith_year
, birth_month
and birth_date
, a new column containing birth date of type Timestamp
will be created.
Also returns a Transformer that can be later applied
to another DataFrame with a Transform operation.
Since: Seahorse 1.3.0
Port |
Type Qualifier |
Description |
0 |
DataFrame |
The DataFrame with the timestamp part columns to compose. |
Output
Port |
Type Qualifier |
Description |
0 |
DataFrame |
The DataFrame with new column with timestamp composed from the original timestamp part columns. |
1 |
Transformer |
The transformer that allows to apply the operation on another DataFrame using a
Transform. |
Parameters
Name |
Type |
Description |
parts |
MultipleChoice |
Columns containing parts of the timestamp to be composed.
Every choice has a nested SingleColumnSelector .
Possible values are pairs of timestamp part: [year, month, day, hour, minutes, seconds] and the selection of the column containing that part.
If the column selected by the user has a type other than Numeric ,
WrongColumnTypeException will be thrown.
If the selected column does not exist, a ColumnDoesNotExistException will be thrown. |
output column |
String |
Name of the result column. |
Example
Parameters
Name |
Value |
parts |
[(year, "year"), (month, "month"), (day, "day"), (hour, "hour")] |
output column |
"birthdate" |
name |
year |
month |
day |
hour |
Ashley |
1978.0 |
3.0 |
2.0 |
1.0 |
Tali |
1982.0 |
1.0 |
2.0 |
3.0 |
Liara |
1902.0 |
11.0 |
20.0 |
5.0 |
Miranda |
1993.0 |
5.0 |
1.0 |
17.0 |
Samara |
1921.0 |
9.0 |
29.0 |
22.0 |
Jack |
1990.0 |
4.0 |
2.0 |
7.0 |
Edi |
2006.0 |
8.0 |
4.0 |
20.0 |
Kasumi |
1962.0 |
4.0 |
17.0 |
16.0 |
Output
name |
year |
month |
day |
hour |
birthdate |
Ashley |
1978.0 |
3.0 |
2.0 |
1.0 |
1978-03-02 01:00:00.0 |
Tali |
1982.0 |
1.0 |
2.0 |
3.0 |
1982-01-02 03:00:00.0 |
Liara |
1902.0 |
11.0 |
20.0 |
5.0 |
1902-11-20 05:00:00.0 |
Miranda |
1993.0 |
5.0 |
1.0 |
17.0 |
1993-05-01 17:00:00.0 |
Samara |
1921.0 |
9.0 |
29.0 |
22.0 |
1921-09-29 22:00:00.0 |
Jack |
1990.0 |
4.0 |
2.0 |
7.0 |
1990-04-02 07:00:00.0 |
Edi |
2006.0 |
8.0 |
4.0 |
20.0 |
2006-08-04 20:00:00.0 |
Kasumi |
1962.0 |
4.0 |
17.0 |
16.0 |
1962-04-17 16:00:00.0 |