Importing DateTimes that contain timezones
In this guide we’ll learn how to import fields that have DateTime strings in various formats, including one with timezones. We’ll start with the following file,events.json, that contains JSON documents:
ts- epoch milliseconds.ts1- DateTime string of the formatEEE dd MMM YYYY HH:mm:ss Z.ts2- DateTime string of the formatYYYY-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:
Transformation functions to apply
After you’ve updated each column, click Apply to apply your changes.
For the field
ts4 we need to change Date Time Format to ISO DATETIME.
Making this change will change the field type to STRING.
Using native DateTime formats in Pinot
The above section is helpful when you want to transform incoming time formats into Milliseconds Epoch which is generally more performant. Alternatively, you could also use Pinot’s built in DateTime format support as follows: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:
For a full list of supported DateTime formats in Pinot please refer to this link.
Now click on Pinot Data and you should see the following:

ts.



