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

Julian Hyde commented on CALCITE-6739:
--------------------------------------

Ah, I was not aware of the cast restrictions. I had assumed that the only 
difference between INTERVAL YEAR TO MONTH and INTERVAL MONTH was how the values 
are formatted.

> 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)

Reply via email to