You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2026/09/28 01:30:00 UTC
[jira] [Commented] (IMPALA-14911) Calcite planner: Failure comparing boolean to numeric
[ https://issues.apache.org/jira/browse/IMPALA-14911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18119917#comment-18119917 ]
ASF subversion and git services commented on IMPALA-14911:
----------------------------------------------------------
Commit 3d4d47dc30c9913d34bd0ac0331fc15d31e5dab5 in impala's branch refs/heads/master from Steve Carlin
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=3d4d47dc3 ]
IMPALA-14911: Calcite planner: Fix boolean to numeric comparison
This commit fixes the following failure in the Calcite planner:
select count(*) from functional.alltypestiny
where smallint_col > sleep(100);
The coercion method for binary comparison is overridden to return
the common type as the numeric so that the internals of Calcite
create the cast around the boolean operand. Calcite only applied
the cast to "equals" binary comparisons. For Decimal, the common
type is FLOAT.
The booleanEquality method was also overridden because Calcite
does coercion in there as well. it will always return false so
that all binary comparison coercions are done in the overridden
commonTypeForBinaryComparison method.
The RexBuilder makeCast method had to be overridden because the
default Calcite handles boolean casting with a case statement
whereas Impala can handle casts the boolean directly to a
numeric type.
Change-Id: I764dcbd2fd0d1323bfb964ed91d94cd3def594c0
Testing: added e2e test
Reviewed-on: http://gerrit.cloudera.org:8080/24217
Tested-by: Impala Public Jenkins <im...@cloudera.com>
Reviewed-by: Steve Carlin <sc...@cloudera.com>
> Calcite planner: Failure comparing boolean to numeric
> -----------------------------------------------------
>
> Key: IMPALA-14911
> URL: https://issues.apache.org/jira/browse/IMPALA-14911
> Project: IMPALA
> Issue Type: Sub-task
> Reporter: Steve Carlin
> Assignee: Steve Carlin
> Priority: Major
>
> The following query fails in the Calcite planner:
> select count(*) from functional.alltypestiny where smallint_col > sleep(100);
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org