You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by tk...@apache.org on 2026/08/28 13:13:13 UTC

(ignite) branch ignite-29021 created (now e2b035785f9)

This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a change to branch ignite-29021
in repository https://gitbox.apache.org/repos/asf/ignite.git


      at e2b035785f9 IGNITE-29021 Wip

This branch includes the following new commits:

     new e2b035785f9 IGNITE-29021 Wip

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(ignite) 01/01: IGNITE-29021 Wip

Posted by tk...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

tkalkirill pushed a commit to branch ignite-29021
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit e2b035785f985bae16b880c1b110bb22f0a83feb
Author: Kirill Tkalenko <tk...@yandex.ru>
AuthorDate: Fri Aug 28 16:12:47 2026 +0300

    IGNITE-29021 Wip
---
 .../query/calcite/exec/exp/ConverterUtils.java          |  4 ++--
 .../UserDefinedFunctionsIntegrationTest.java            | 17 +++++++++++++++++
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java
index fbbdc18be36..3d61ad80048 100644
--- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java
+++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java
@@ -495,9 +495,9 @@ public class ConverterUtils {
      * Handles decimal type specifically with explicit type conversion.
      */
     private static Expression convertAssignableType(Expression argument, Type targetType) {
-        if (targetType != BigDecimal.class)
+        if (targetType != BigDecimal.class || !Types.needTypeCast(argument.getType(), targetType))
             return argument;
 
-        return convert(argument, targetType);
+        return convertToDecimal(argument, Commons.typeFactory().createSqlType(SqlTypeName.DECIMAL));
     }
 }
diff --git a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java
index 0217b6359bb..7fff7a10818 100644
--- a/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java
+++ b/modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java
@@ -17,6 +17,7 @@
 
 package org.apache.ignite.internal.processors.query.calcite.integration;
 
+import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.util.Arrays;
 import java.util.Collection;
@@ -452,6 +453,16 @@ public class UserDefinedFunctionsIntegrationTest extends AbstractBasicIntegratio
         );
     }
 
+    /** */
+    @Test
+    public void testBigDecimalFunctionArgument() {
+        client.getOrCreateCache(new CacheConfiguration<>("decimal-functions")
+            .setSqlSchema("UDF")
+            .setSqlFunctionClasses(OtherFunctionsLibrary2.class));
+
+        assertQuery("SELECT udf.decimalToInt(5)").returns(5).check();
+    }
+
     /** */
     @SuppressWarnings("ThrowableNotThrown")
     private void assertThrows(String sql) {
@@ -739,6 +750,12 @@ public class UserDefinedFunctionsIntegrationTest extends AbstractBasicIntegratio
         public static int sameSign2(int v) {
             return v;
         }
+
+        /** */
+        @QuerySqlFunction
+        public static int decimalToInt(BigDecimal val) {
+            return val.intValue();
+        }
     }
 
     /** */