Skip to content

Commit

Permalink
mask function support
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyangxiaozhu committed Jun 28, 2024
1 parent 86449d0 commit 33d38a3
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,24 @@ class ScalarFunctionsValidateSuite extends FunctionsValidateTest {
}
}

testWithSpecifiedSparkVersion("mask", Some("3.5")) {
runQueryAndCompare("SELECT mask(c_comment) FROM customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
runQueryAndCompare("SELECT mask(c_comment, 'Y') FROM customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
runQueryAndCompare("SELECT mask(c_comment, 'Y', 'y') FROM customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
runQueryAndCompare("SELECT mask(c_comment, 'Y', 'y', 'o') FROM customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
runQueryAndCompare("SELECT mask(c_comment, 'Y', 'y', 'o', '*') FROM customer limit 50") {
checkGlutenOperatorMatch[ProjectExecTransformer]
}
}

test("bit_length") {
runQueryAndCompare(
"select bit_length(c_comment), bit_length(cast(c_comment as binary))" +
Expand Down
4 changes: 2 additions & 2 deletions ep/build-velox/src/get_velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

set -exu

VELOX_REPO=https://github.com/oap-project/velox.git
VELOX_BRANCH=2024_06_28
VELOX_REPO=https://github.com/gaoyangxiaozhu/velox.git
VELOX_BRANCH=gayangya/mask_oap
VELOX_HOME=""

#Set on run gluten on HDFS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ object ExpressionNames {
final val LEVENSHTEIN = "levenshteinDistance"
final val UNBASE64 = "unbase64"
final val BASE64 = "base64"
final val MASK = "mask"

// URL functions
final val PARSE_URL = "parse_url"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ class Spark35Shims extends SparkShims {
Sig[Sec](ExpressionNames.SEC),
Sig[Csc](ExpressionNames.CSC),
Sig[KnownNullable](ExpressionNames.KNOWN_NULLABLE),
Sig[Empty2Null](ExpressionNames.EMPTY2NULL)
Sig[Empty2Null](ExpressionNames.EMPTY2NULL),
Sig[Mask](ExpressionNames.MASK)
)
}

Expand Down

0 comments on commit 33d38a3

Please sign in to comment.