diff --git a/backends-velox/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala index 9fa0d336a45..6f4ea376c92 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/functions/MathFunctionsValidateSuite.scala @@ -66,7 +66,7 @@ class MathFunctionsValidateSuiteAnsiOn extends FunctionsValidateSuite { } } -abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite { +class MathFunctionsValidateSuite extends FunctionsValidateSuite { disableFallbackCheck import testImplicits._ @@ -248,6 +248,17 @@ abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite { } } + test("ln") { + runQueryAndCompare("SELECT ln(l_orderkey) from lineitem limit 1") { + checkGlutenPlan[ProjectExecTransformer] + } + // Verify null semantics: ln(0) and ln(-1) must return null, not -Infinity/NaN + compareResultsAgainstVanillaSpark( + "SELECT ln(0), ln(-1), ln(cast(null as double))", + true, + { _ => }) + } + test("log") { runQueryAndCompare("SELECT log(10, l_orderkey) from lineitem limit 1") { checkGlutenPlan[ProjectExecTransformer] @@ -295,6 +306,12 @@ abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite { } } + test("radians") { + runQueryAndCompare("SELECT radians(l_orderkey) from lineitem limit 1") { + checkGlutenPlan[ProjectExecTransformer] + } + } + test("rint") { withTempPath { path => @@ -332,6 +349,24 @@ abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite { } } + test("sin") { + runQueryAndCompare("SELECT sin(l_orderkey) from lineitem limit 1") { + checkGlutenPlan[ProjectExecTransformer] + } + } + + test("tan") { + runQueryAndCompare("SELECT tan(l_orderkey) from lineitem limit 1") { + checkGlutenPlan[ProjectExecTransformer] + } + } + + test("tanh") { + runQueryAndCompare("SELECT tanh(l_orderkey) from lineitem limit 1") { + checkGlutenPlan[ProjectExecTransformer] + } + } + test("try_add") { runQueryAndCompare( "select try_add(cast(l_orderkey as int), 1), try_add(cast(l_orderkey as int), 2147483647)" + @@ -414,7 +449,9 @@ abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite { } } - test("decimal arithmetic respects allowPrecisionLoss captured at view analysis time") { + testWithMinSparkVersion( + "decimal arithmetic respects allowPrecisionLoss captured at view analysis time", + "4.1") { // Regression test for GLUTEN-11917: in Spark 4.1, arithmetic expressions embed // allowPrecisionLoss in their evalContext at analysis time. Gluten must read from // the expression rather than SQLConf.get, which can differ when querying a view diff --git a/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala b/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala index cd49c23029b..8c343890bd0 100644 --- a/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala +++ b/backends-velox/src/test/scala/org/apache/gluten/functions/ScalarFunctionsValidateSuite.scala @@ -26,7 +26,8 @@ import org.apache.spark.sql.execution.ProjectExec import org.apache.spark.sql.internal.SQLConf import org.apache.spark.sql.types._ -abstract class ScalarFunctionsValidateSuite extends FunctionsValidateSuite { +class ScalarFunctionsValidateSuite extends FunctionsValidateSuite { + disableFallbackCheck import testImplicits._ diff --git a/ep/build-velox/src/get-velox.sh b/ep/build-velox/src/get-velox.sh index 3b1b3abcc9a..37cd06223ce 100755 --- a/ep/build-velox/src/get-velox.sh +++ b/ep/build-velox/src/get-velox.sh @@ -25,7 +25,7 @@ RUN_SETUP_SCRIPT=ON ENABLE_ENHANCED_FEATURES=OFF # Developer use only for testing Velox PR. -UPSTREAM_VELOX_PR_ID="" +UPSTREAM_VELOX_PR_ID="17648" OS=`uname -s`