Pinot Version | 1.0.0 |
---|---|
Code | startreedata/pinot-recipes/datetime-string-to-timestamp |
Prerequisites
To follow the code examples in this guide, you must install Docker locally and download recipes.Navigate to recipe
- If you haven’t already, download recipes.
- In terminal, go to the recipe by running the following command:
Launch Pinot Cluster and Kafka
You can spin up a Pinot Cluster and Kafka Broker by running the following command:DateTime Strings in Pinot
Pinot automatically creates Timestamps from DateTime strings that are in the following format:yyyy-mm-dd hh:mm:ss[.fffffffff]
- Millis since epoch
Add Schema and Table
Now let’s create a Pinot Schema and Table.- Map
timestamp1
from the data source into theDate1
column - Map
timestamp2
from the data source into theDate2
column - Map
timestamp3
from the data source into theDate3
column, with help from the function. - Map
timestamp4
from the data source into theDate1
column
Ingesting Data into Kafka
We can ingest a message into Kafka by running the following command:Querying
Once that’s completed, navigate to localhost:9000/#/query and click on the dates table or copy/paste the following query:Date1 | Date2 | Date3 | Date4 |
---|---|---|---|
2019-10-09 22:25:25.0 | 2019-10-09 21:25:25.0 | 2019-10-09 22:25:25.0 | 2019-10-09 22:25:25.0 |