[
https://issues.apache.org/jira/browse/CALCITE-613?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14354023#comment-14354023
]
Julian Hyde commented on CALCITE-613:
-------------------------------------
It makes sense to solve these use cases, especially those involving DATE, TIME,
TIMESTAMP. I'd do it by making BETWEEN (and other operators such as <) more
flexible in the types of argument they support, and then introducing an
implicit cast.
We need to be careful converting numerics. Consider what MySQL does:
{code}mysql> select '10' || '0' > 900;
+-------------------+
| '10' || '0' > 900 |
+-------------------+
| 1 |
+-------------------+
1 row in set (0.00 sec)
mysql> select '100' > 900;
+-------------+
| '100' > 900 |
+-------------+
| 0 |
+-------------+
1 row in set (0.00 sec)
{code}
Do we really want that mess? I don't think so.
> Literals need to be treated more flexible
> -----------------------------------------
>
> Key: CALCITE-613
> URL: https://issues.apache.org/jira/browse/CALCITE-613
> Project: Calcite
> Issue Type: Bug
> Reporter: Sean Hsuan-Yi Chu
> Assignee: Julian Hyde
>
> In relational DB such as Postgres, this query works fine.
> "select ... from ... where column (INT type) between '10' and '11'"
> Calcite blocks this query early by the fact that data types "char" &
> "integer" are not directly compatible. However, this is very common for
> people to filter columns with date types. For example,
> "...where date between '1911-01-01' and '1911-01-02' "
> To relax this type check when comparing with literals can help improve
> usability.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)