[
https://issues.apache.org/jira/browse/CALCITE-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907459#comment-17907459
]
Mihai Budiu commented on CALCITE-6739:
--------------------------------------
At runtime there are only two types, but the static type system recognizes many
more interval types, and not all support the same operations.
For example, you are allowed to cast INTERVAL MONTHS to INTEGER, but you are
not allowed to cast INTERVAL YEARS TO MONTHS to INTEGER.
> Explicit cast of ARRAY to VARCHAR is rejected, but implicit is not
> ------------------------------------------------------------------
>
> Key: CALCITE-6739
> URL: https://issues.apache.org/jira/browse/CALCITE-6739
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.38.0
> Reporter: Mihai Budiu
> Priority: Minor
>
> Calcite will happily cast implicitly an ARRAY to a VARCHAR, but will refuse
> to do it using an explicit CAST. In general, I believe that anything that can
> be done implicitly should also be allowed explicitly.
> As a proof, the first test in postgres.iq is:
> {code:sql}
> # Test string and array comparison
> select array[0,1,2] = '{0,1,2}';
> EXPR$0
> true
> {code}
> The matrix in
> https://calcite.apache.org/docs/reference.html#implicit-type-conversion says
> that even implicit casting should be rejected.
> As an aside, the matrix is woefully incomplete, since it is missing ROW,
> MULTISET types, and all the INTERVAL types are bundled as a single type.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)