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

mbudiu pushed a commit to branch issue2067
in repository https://gitbox.apache.org/repos/asf/calcite.git

commit e51b5ae36955d21f7fe6bba360503fb949374f6d
Author: Mihai Budiu <[email protected]>
AuthorDate: Thu Aug 1 14:41:51 2024 -0700

    Change test from ln to division by zero, since semantics of ln has changed
    
    Signed-off-by: Mihai Budiu <[email protected]>
---
 core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java     | 4 ++--
 core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java 
b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
index 7c92606844..cb15194c03 100644
--- a/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
+++ b/core/src/test/java/org/apache/calcite/test/RelOptRulesTest.java
@@ -3360,9 +3360,9 @@ class RelOptRulesTest extends RelOptTestBase {
    * including NaN, Infinity</a>. */
   @Test public void testDoubleReduction2() {
     // Without the fix for CALCITE-2067 the following expression is not
-    // reduced to NaN, since NaN cannot be represented
+    // reduced to Infinity, since Infinity cannot be represented
     // as a BigDecimal value.
-    final String sql2 = "SELECT ln(-2)";
+    final String sql2 = "SELECT 1.0 / 0.0e0";
     sql(sql2)
         .withRule(CoreRules.PROJECT_REDUCE_EXPRESSIONS)
         .check();
diff --git 
a/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml 
b/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
index efc1f8bc57..cceee4df87 100644
--- a/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
+++ b/core/src/test/resources/org/apache/calcite/test/RelOptRulesTest.xml
@@ -3048,17 +3048,17 @@ LogicalProject(EXPR$0=[1008618.4899999999E0:DOUBLE])
   </TestCase>
   <TestCase name="testDoubleReduction2">
     <Resource name="sql">
-      <![CDATA[SELECT ln(-2)]]>
+      <![CDATA[SELECT 1.0 / 0.0e0]]>
     </Resource>
     <Resource name="planBefore">
       <![CDATA[
-LogicalProject(EXPR$0=[LN(-2)])
+LogicalProject(EXPR$0=[/(1.0:DECIMAL(2, 1), 0.0E0:DOUBLE)])
   LogicalValues(tuples=[[{ 0 }]])
 ]]>
     </Resource>
     <Resource name="planAfter">
       <![CDATA[
-LogicalProject(EXPR$0=[NaN:DOUBLE])
+LogicalProject(EXPR$0=[Infinity:DOUBLE])
   LogicalValues(tuples=[[{ 0 }]])
 ]]>
     </Resource>

Reply via email to