Mihai Budiu created CALCITE-6739:
------------------------------------

             Summary: 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


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