In this guide we’ll learn how to import fields that have DateTime strings that contain timezones using StarTree Data Manager.
events.json
that contains JSON documents :
ts
- epoch milliseconds.ts1
- DateTime string of the format EEE dd MMM YYYY HH:mm:ss Z
.ts2
- DateTime string of the format YYYY-MM-dd HH:mm:ss
.ts3
- epoch seconds.ts4
- DateTime string of the ISO DateTime format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z'
)DATETIME
:
ts
column is already in the right format, but we’ll need to apply transformation functions to the ts1
, ts2
, and ts3
columns.
If you click on the cog icon next to each row, you’ll see a modal window like this:
Mapping Function
based on the table below:
Current column name | New column name | Transformation function |
---|---|---|
ts1 | timestamp1 | |
ts2 | timestamp2 | |
ts3 | timestamp3 | |
ts4
we need to change Date Time Format to ISO DATETIME
.
Making this change will change the field type to STRING
.
Current column name | DateTime Format |
---|---|
ts2 | |
ts3 | |
ts4 | |
Note: ts1 - DateTime string of the format EEE dd MMM YYYY HH:mm:ss Z is not natively supported in Pinot. This is because there is no way to sort this string on lexicographical and datetime order
Here’s how the corresponding Pinot schema would look like:
Here are some other commonly used examples:
Sample | DateTime Format |
---|---|
2025-04-01T14:31:16.551-05:00 | |
ts
.