You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksey Plekhanov (Jira)" <ji...@apache.org> on 2022/11/29 14:17:00 UTC
[jira] [Commented] (IGNITE-18274) Exception on modulus operator in SQL
[ https://issues.apache.org/jira/browse/IGNITE-18274?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17640731#comment-17640731 ]
Aleksey Plekhanov commented on IGNITE-18274:
--------------------------------------------
Simplified reproducer:
{noformat}
SELECT 1.0 % 2{noformat}
> Exception on modulus operator in SQL
> ------------------------------------
>
> Key: IGNITE-18274
> URL: https://issues.apache.org/jira/browse/IGNITE-18274
> Project: Ignite
> Issue Type: Bug
> Components: sql
> Reporter: Pavel Tupitsyn
> Priority: Major
> Labels: calcite, calcite2-required, calcite3-required, ignite-3
> Fix For: 3.0.0-beta2
>
>
> *Query*
> {code}
> select key % 2 from TBL_DOUBLE
> {code}
> *Result*
> {code}
> java.lang.AssertionError: Conversion to relational algebra failed to preserve datatypes:
> validated type:
> RecordType(INTEGER NOT NULL KEY % 2) NOT NULL
> converted type:
> RecordType(DECIMAL(25, 15) NOT NULL KEY % 2) NOT NULL
> rel:
> LogicalProject(KEY % 2=[MOD(CAST($0):DECIMAL(30, 15) NOT NULL, 2)])
> IgniteLogicalTableScan(table=[[PUBLIC, TBL_DOUBLE]])
> at org.apache.calcite.sql2rel.SqlToRelConverter.checkConvertedType(SqlToRelConverter.java:492)
> at org.apache.calcite.sql2rel.SqlToRelConverter.convertQuery(SqlToRelConverter.java:607)
> at org.apache.ignite.internal.sql.engine.prepare.IgnitePlanner.rel(IgnitePlanner.java:222)
> at org.apache.ignite.internal.sql.engine.prepare.PlannerHelper.optimize(PlannerHelper.java:63)
> at org.apache.ignite.internal.sql.engine.prepare.PrepareServiceImpl.lambda$prepareQuery$1(PrepareServiceImpl.java:231)
> at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
> at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
> at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
> at java.base/java.lang.Thread.run(Thread.java:829)
> {code}
> Note that some simple queries like "select 1 % 2" work.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)