Mayank
Sadim Nadeem
01/09/2022, 4:28 PM"dateTimeFieldSpecs": [
{
"name": "Timestamp",
"dataType": "STRING",
"format": "1:HOURS:SIMPLE_DATE_FORMAT:dd/MM/yyyy HH:mm:ss",
"granularity": "1:SECONDS"
}
]Sadim Nadeem
01/09/2022, 4:28 PMSadim Nadeem
01/09/2022, 4:29 PMSadim Nadeem
01/09/2022, 5:15 PMXiang Fu
: this is used as delimeterSadim Nadeem
01/13/2022, 7:16 AMRong R
01/13/2022, 6:30 PMXiang Fu
Xiang Fu
Mark Needham
Sadim Nadeem
01/14/2022, 4:50 AMfinal SimpleDateFormat inputFmt = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
final SimpleDateFormat outputFmt = new SimpleDateFormat("dd/MM/yyyy HH:mm");
final SimpleDateFormat outputFmtLex = new SimpleDateFormat("yyyy/MM/dd HH:mm");
final SimpleDateFormat outputFmtWithSecond = new SimpleDateFormat("dd/MM/yyyy HH:mm:ss");
final SimpleDateFormat outputFmtWithSecondLex = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
final TimeZone zone = TimeZone.getTimeZone("UTC");
public DateTransform() {
inputFmt.setTimeZone(zone);//"UTC"));
outputFmt.setTimeZone(zone);
outputFmtLex.setTimeZone(zone);
outputFmtWithSecond.setTimeZone(zone);
outputFmtWithSecondLex.setTimeZone(zone);
}
public AllowFlowL3L4V2 dateTransform(AllowFlowL3L4V2 pojo, SimpleDateFormat inputFormat, SimpleDateFormat outputFormat, String dateInput) {
String newDateInput;
if (dateInput.length()>22) {
newDateInput = dateInput.substring(0,22);
newDateInput = newDateInput+"Z";
}
else
newDateInput = dateInput;
Date d = null;
try {
d = inputFormat.parse(newDateInput);//"2018-02-02T06:54:57.744Z");
} catch (ParseException e) {
logger.error(e);
}
String formatted = "";
try {
formatted = outputFormat.format(d);
} catch (NullPointerException e) {
logger.error(e);
}
logger.debug("DATE " + formatted);
pojo.setTime(formatted);
return pojo;
}Sadim Nadeem
01/14/2022, 4:53 AMMark Needham
TIMESTAMP field type, which IMO gives you the best of both worlds!
You're able to see what the actual date is, as well as perform date calculations over the field.
I wrote a couple of blog posts showing how to do it.
https://www.markhneedham.com/blog/2021/12/07/apache-pinot-exploring-range-queries/
https://www.markhneedham.com/blog/2021/12/03/apache-pinot-convert-datetime-string-timestamp-invalid-timestamp/Sadim Nadeem
01/14/2022, 6:41 PMRong R
01/16/2022, 11:35 PM>= or <= comparison on this date time string column - which is the limiting factor for why we can’t allow mm/dd/yyyy format because of the single-storage-format / 2-sorting-orders dilemma.
I guess a more systematic way to fix this issue is to provide a new dataType called “TIMESTAMP” and “DATETIME”. which only support sorting in epoch order. while “TIMESTAMP” returns a “LONG” basic type, and “DATETIME” returns a “STRING” basic typeSadim Nadeem
01/17/2022, 4:20 AM>= or <= comparison on this date time string column ... thanks @Rong R for the detailed explanationSid
04/03/2023, 12:22 PM