xiangfu0 commented on code in PR #11097:
URL: https://github.com/apache/pinot/pull/11097#discussion_r1264364074
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/MultiStageEngineIntegrationTest.java:
##########
@@ -116,6 +127,364 @@ public void testMultiValueColumnSelectionQuery()
testQueryWithMatchingRowCount(pinotQuery, h2Query);
}
+ @Test
+ public void testTimeFunc()
+ throws Exception {
+ String sqlQuery = "SELECT toDateTime(now(), 'yyyy-MM-dd z'),
toDateTime(ago('PT1H'), 'yyyy-MM-dd z') FROM mytable";
+ JsonNode response = postQuery(sqlQuery);
+ System.out.println("response = " + response);
+ String todayStr =
response.get("resultTable").get("rows").get(0).get(0).asText();
+ String expectedTodayStr =
+
Instant.now().atZone(ZoneId.of("UTC")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd
z"));
+ assertEquals(todayStr, expectedTodayStr);
+
+ String oneHourAgoTodayStr =
response.get("resultTable").get("rows").get(0).get(1).asText();
+ String expectedOneHourAgoTodayStr =
Instant.now().minus(Duration.parse("PT1H")).atZone(ZoneId.of("UTC"))
+ .format(DateTimeFormatter.ofPattern("yyyy-MM-dd z"));
+ assertEquals(oneHourAgoTodayStr, expectedOneHourAgoTodayStr);
+ }
+
+ @Test
+ public void testRegexpReplace()
Review Comment:
will add more tests
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]