[
https://issues.apache.org/jira/browse/CALCITE-6631?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17890507#comment-17890507
]
Mihai Budiu commented on CALCITE-6631:
--------------------------------------
The question is: when is it legal to compare types like that?
Do they come from different type systems?
What is the spec of the correct result in this case?
I am worried that this is actually hiding a bug somewhere else.
> The common type for a comparison operator returns the wrong type when
> comparing a Java type long with a SQL type INTEGER
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: CALCITE-6631
> URL: https://issues.apache.org/jira/browse/CALCITE-6631
> Project: Calcite
> Issue Type: Bug
> Affects Versions: 1.38.0
> Reporter: xiong duan
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.39.0
>
>
> The unit test:
> {code:java}
> RelDataType longJavaType = this.typeFactory.createJavaType(Long.class);
> @Test void testComparisonJavaTypeAndSqlTypeCoercion() {
> final Fixture f = fixture();
> f.comparisonCommonType(f.intType, f.longJavaType, null);
> }{code}
> The common type for a comparison operator when when comparing a Java type
> long with a SQL type INTEGER should return LONG type or NULL, now return the
> INTEGER type.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)