You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Dan Zou (Jira)" <ji...@apache.org> on 2023/04/07 12:56:00 UTC

[jira] [Commented] (CALCITE-5636) Consult type mappings when coercing types.

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

Dan Zou commented on CALCITE-5636:
----------------------------------

Hi [~wnoble], you have created two duplicate jira CALCITE-5635 and CALCITE-5636

> Consult type mappings when coercing types.
> ------------------------------------------
>
>                 Key: CALCITE-5636
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5636
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Will Noble
>            Priority: Major
>
> This is another offshoot of CALCITE-5346.
> In [{{AbstractTypeCoercion.implicitCast}}|https://github.com/apache/calcite/blob/2dba40e7a0a5651eac5a30d9e0a72f178bd9bff2/core/src/main/java/org/apache/calcite/sql/validate/implicit/AbstractTypeCoercion.java#L713], Calcite may insert {{CAST}} invocations disregarding the root schema type map. This happens during the validation phase, so it's easy enough to read the type map directly in the {{AbstractTypeCoercion}} utility, although it's hard to say if this is an optimal solution. It may make sense to incorporate the type map into the {{RelDataTypeSystem}} which is more widely available in non-validation phases of SQL processing pipelines.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)