pnowojski commented on a change in pull request #6614: [FLINK-9432] [table]
Support extract timeunit: DECADE, EPOCH, ISODOW, ISOYEAR…
URL: https://github.com/apache/flink/pull/6614#discussion_r220159913
##########
File path:
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/ScalarFunctionsTest.scala
##########
@@ -1852,6 +1852,42 @@ class ScalarFunctionsTest extends ScalarTypesTestBase {
"EXTRACT(DOY FROM f16)",
"315")
+ testSqlApi(
+ "EXTRACT(EPOCH FROM f18)",
+ "847608883")
+
+ testSqlApi(
+ "EXTRACT(EPOCH FROM TIMESTAMP '2018-10-11 12:23:12.345')",
+ "1539260582")
+
+ // TODO looks like a Calcite issue for cases like extract(millisecond from
date)
+ // should be 0 but not
+ //testSqlApi(
+ // "EXTRACT(MILLISECOND FROM f16)",
+ // "0")
+
+ testSqlApi(
+ "EXTRACT(MILLISECOND FROM TIMESTAMP '2018-10-11 12:23:12.345')",
+ "345")
+
+ testSqlApi(
+ "EXTRACT(MILLISECOND FROM TIME '10:54:41.096')",
+ "96")
+
+ // TODO looks like a Calcite issue for cases like extract(microsecond from
date)
+ // should be 0 but not
+ //testSqlApi(
+ // "EXTRACT(MICROSECOND FROM f16)",
Review comment:
ditto
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services