Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class MathFunctionsValidateSuiteAnsiOn extends FunctionsValidateSuite {
}
}

abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite {
class MathFunctionsValidateSuite extends FunctionsValidateSuite {

disableFallbackCheck
import testImplicits._
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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 =>
Expand Down Expand Up @@ -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)" +
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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._
Expand Down
2 changes: 1 addition & 1 deletion ep/build-velox/src/get-velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
Loading