[
https://issues.apache.org/jira/browse/FLINK-9482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16504297#comment-16504297
]
ASF GitHub Bot commented on FLINK-9482:
---------------------------------------
Github user suez1224 commented on a diff in the pull request:
https://github.com/apache/flink/pull/6121#discussion_r193637621
--- Diff:
flink-libraries/flink-table/src/test/scala/org/apache/flink/table/expressions/validation/ScalarFunctionsValidationTest.scala
---
@@ -98,16 +98,45 @@ class ScalarFunctionsValidationTest extends
ScalarTypesTestBase {
testSqlApi("TIMESTAMPADD(YEAR, 1.0, timestamp '2016-02-24 12:42:25')",
"2016-06-16")
}
- @Test(expected = classOf[CodeGenException])
+ @Test(expected = classOf[ValidationException])
def testDOWWithTimeWhichIsUnsupported(): Unit = {
testSqlApi("EXTRACT(DOW FROM TIME '12:42:25')", "0")
}
- @Test(expected = classOf[CodeGenException])
+ @Test(expected = classOf[ValidationException])
def testDOYWithTimeWhichIsUnsupported(): Unit = {
testSqlApi("EXTRACT(DOY FROM TIME '12:42:25')", "0")
}
+ def testExtractFromTimeZeroResult(unit: TimeUnit): Unit = {
--- End diff --
Let's make this method private.
> Not applicable functions for TIME
> ---------------------------------
>
> Key: FLINK-9482
> URL: https://issues.apache.org/jira/browse/FLINK-9482
> Project: Flink
> Issue Type: Bug
> Components: Table API & SQL
> Reporter: Viktor Vlasov
> Assignee: Viktor Vlasov
> Priority: Minor
>
> Due to work on https://issues.apache.org/jira/browse/FLINK-9432 I have faced
> with question how to check DECADE function with tests in
> _org/apache/flink/table/expressions/validation/ScalarFunctionsValidationTest.scala._
>
> Because I have used CENTURY function as an example, first of all I have check
> it. During the test I figured out that when we use it with TIME it returns 0.
> I suppose arguments for such functions (also it works for YEAR, MONTH,
> MILLENNIUM, etc) need to be checked and throw some exception if type is not
> suitable.
> As an example, in Apache Calcite project (checked in sqlline shell), when I
> am trying to use CENTURY with TIME it throw:
> {code:java}
> java.lang.AssertionError: unexpected TIME
> {code}
> Need to determine, why such check is not exists and add it.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)