[
https://issues.apache.org/jira/browse/CALCITE-6739?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17907448#comment-17907448
]
Julian Hyde edited comment on CALCITE-6739 at 12/20/24 5:06 PM:
----------------------------------------------------------------
There are only really two INTERVAL types: MONTH and SECOND. The others are
variations, just as precision and scale can be varied in the DECIMAL type.
This case reminds me how useful it would be to be able to run tests against
Postgres as a live reference database, as opposed to conducting experiments on
Postgres and manually transcribing results into test cases. If we had a live
database we could just write a test with a “for” loop to generate the matrix.
I hope my work on CALCITE-5529 will help.
was (Author: julianhyde):
There are only really two INTERVAL types: MONTH and SECOND. The others are
variations, just as precision and scale can be varied in the DECIMAL type.
This case reminds me how useful it would be to be able to run tests against
Postgres as a live reference database, as opposed to conducting experiments on
Postgres and manually transcribing results into test cases. If we had a live
database we could just write a test with a “for” loop to generate the matrix.
I hope my work on CALCITE-5299 will help.
> 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)