[jira] [Commented] (CALCITE-1178) Allow SqlBetweenOperator to compare DATE and TIMESTAMP
[ https://issues.apache.org/jira/browse/CALCITE-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16933207#comment-16933207 ] Danny Chan commented on CALCITE-1178: - [~jacobroldan], yeah, you are right, 1.21 supports implicit type coercion for DATE and TIMESTAMP in binary comparison, i think we can support between either. For current coercion rules, for "date > timestamp", we coerce the DATE to TIMESTAMP. [~julianhyde] I have checked MYSQL 5.6 and PostgreSQL 9.6, they have the same behavior with Calcite. > Allow SqlBetweenOperator to compare DATE and TIMESTAMP > -- > > Key: CALCITE-1178 > URL: https://issues.apache.org/jira/browse/CALCITE-1178 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Sean Hsuan-Yi Chu >Assignee: Sean Hsuan-Yi Chu >Priority: Major > > An expression such as > {code} > date '1999-03-02' between date '1999-03-01' and timestamp '1999-03-03 > 00:00:00.0' > {code} > will incur SqlValidatorException since SqlBetweenOperator does not allow DATE > and TIMESTAMP comparison. In terms of usability, it would be great if this > type of comparison is allowed in Calcite. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-1178) Allow SqlBetweenOperator to compare DATE and TIMESTAMP
[ https://issues.apache.org/jira/browse/CALCITE-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16932868#comment-16932868 ] Haisheng Yuan commented on CALCITE-1178: Not a bug. I think it is a yet implemented feature. > Allow SqlBetweenOperator to compare DATE and TIMESTAMP > -- > > Key: CALCITE-1178 > URL: https://issues.apache.org/jira/browse/CALCITE-1178 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Sean Hsuan-Yi Chu >Assignee: Sean Hsuan-Yi Chu >Priority: Major > > An expression such as > {code} > date '1999-03-02' between date '1999-03-01' and timestamp '1999-03-03 > 00:00:00.0' > {code} > will incur SqlValidatorException since SqlBetweenOperator does not allow DATE > and TIMESTAMP comparison. In terms of usability, it would be great if this > type of comparison is allowed in Calcite. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-1178) Allow SqlBetweenOperator to compare DATE and TIMESTAMP
[ https://issues.apache.org/jira/browse/CALCITE-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16932382#comment-16932382 ] Jacob Roldan commented on CALCITE-1178: --- Since calcite 1.21 it's possible to do {code:sql} date '1999-03-02' < timestamp '1999-03-03 00:00:00.0' {code} but not with {{_between_}} I don't know if it's a feature (I haven't seen anything in the release note) or if it's a bug > Allow SqlBetweenOperator to compare DATE and TIMESTAMP > -- > > Key: CALCITE-1178 > URL: https://issues.apache.org/jira/browse/CALCITE-1178 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Sean Hsuan-Yi Chu >Assignee: Sean Hsuan-Yi Chu >Priority: Major > > An expression such as > {code} > date '1999-03-02' between date '1999-03-01' and timestamp '1999-03-03 > 00:00:00.0' > {code} > will incur SqlValidatorException since SqlBetweenOperator does not allow DATE > and TIMESTAMP comparison. In terms of usability, it would be great if this > type of comparison is allowed in Calcite. -- This message was sent by Atlassian Jira (v8.3.4#803005)
[jira] [Commented] (CALCITE-1178) Allow SqlBetweenOperator to compare DATE and TIMESTAMP
[ https://issues.apache.org/jira/browse/CALCITE-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15217414#comment-15217414 ] Julian Hyde commented on CALCITE-1178: -- If we do this, we should also allow other comparisons, e.g. {{aDate < aTimestamp}}. Note that we already allow {{aDate < aString}}, and the string is implicitly converted to a data. This feature should work the same way: the date should be converted to a timestamp, or the timestamp to a date. Which should it be? What do other databases do? > Allow SqlBetweenOperator to compare DATE and TIMESTAMP > -- > > Key: CALCITE-1178 > URL: https://issues.apache.org/jira/browse/CALCITE-1178 > Project: Calcite > Issue Type: Improvement > Components: core >Reporter: Sean Hsuan-Yi Chu >Assignee: Sean Hsuan-Yi Chu > > An expression such as > {code} > date '1999-03-02' between date '1999-03-01' and timestamp '1999-03-03 > 00:00:00.0' > {code} > will incur SqlValidatorException since SqlBetweenOperator does not allow DATE > and TIMESTAMP comparison. In terms of usability, it would be great if this > type of comparison is allowed in Calcite. -- This message was sent by Atlassian JIRA (v6.3.4#6332)