[ 
https://issues.apache.org/jira/browse/CALCITE-1312?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15371801#comment-15371801
 ] 

Julian Hyde commented on CALCITE-1312:
--------------------------------------

* Better to add the test to SqlOperatorBaseTest than SqlValidatorTest. In fact 
you could just add a couple of lines to SqlValidatorTest.testTimestampDiff.
* The tests you've written are a bit abstract. That increases the chance that 
there's a bug in the tests (or will be, after they've been "maintained"). I'd 
get rid of the for loops, write specific test cases, and don't worry that 
they're not 100% exhaustive.
* Only put a strategy in ReturnTypes if it is re-usable by multiple operators.

> timestamp_add(UNIT, DATE) should return timestamp if the unit added is less 
> than a date
> ---------------------------------------------------------------------------------------
>
>                 Key: CALCITE-1312
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1312
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>            Reporter: MinJi Kim
>            Assignee: Julian Hyde
>
> timestamp_add("MINUTE", 1, date '2016-06-15') returns 2016-06-15 since it 
> returns a date and therefore truncates the minute informtion.  timestamp_add 
> should return timestamp instead of date for units less than date.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to