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

Mihai Budiu commented on CALCITE-6541:
--------------------------------------

This one is debatable, Calcite uses the type of the right operand, and 
technically the result will fit within that type.

But at least in Postgres:

SELECT pg_typeof(CAST(123412341 AS BIGINT) % 1000)

returns BIGINT

> Type inference for MOD operator is incorrect
> --------------------------------------------
>
>                 Key: CALCITE-6541
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6541
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.37.0
>            Reporter: Mihai Budiu
>            Priority: Minor
>
> One would expect MOD(BIGINT, INT) to produce a BIGINT result, but the type is 
> inferred as INT.



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

Reply via email to