Skip to content
Merged
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 @@ -302,6 +302,13 @@ abstract class MathFunctionsValidateSuite extends FunctionsValidateSuite {
}
}

testWithMinSparkVersion("randstr", "4.0") {
// randstr generates random strings, so we only verify native execution, not result equality.
runQueryAndCompare("SELECT randstr(5, 0) from lineitem limit 100", compareResult = false) {
checkGlutenPlan[ProjectExecTransformer]
}
}

test("rint") {
withTempPath {
path =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ object ExpressionNames {
final val REMAINDER = "modulus"
final val FACTORIAL = "factorial"
final val RAND = "rand"
final val RANDSTR = "randstr"
final val RINT = "rint"
final val RIGHT = "right"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class Spark40Shims extends SparkShims {
Sig[UrlEncode](ExpressionNames.URL_ENCODE),
Sig[KnownNotContainsNull](ExpressionNames.KNOWN_NOT_CONTAINS_NULL),
Sig[UrlDecode](ExpressionNames.URL_DECODE),
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING)
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING),
Sig[RandStr](ExpressionNames.RANDSTR)
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ class Spark41Shims extends SparkShims {
Sig[UrlEncode](ExpressionNames.URL_ENCODE),
Sig[KnownNotContainsNull](ExpressionNames.KNOWN_NOT_CONTAINS_NULL),
Sig[UrlDecode](ExpressionNames.URL_DECODE),
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING)
Sig[ToPrettyString](ExpressionNames.TO_PRETTY_STRING),
Sig[RandStr](ExpressionNames.RANDSTR)
)
}

Expand Down