Skip to content

Commit

Permalink
[GLUTEN-4479][VL] Map unbase64 to a presto function
Browse files Browse the repository at this point in the history
  • Loading branch information
fyp711 committed Jan 23, 2024
1 parent a85f066 commit b63adf2
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,10 @@ class VeloxFunctionsValidateSuite extends VeloxWholeStageTransformerSuite {
checkOperatorMatch[ProjectExecTransformer]
}
}

test("Test unbase64 function") {
runQueryAndCompare("SELECT unbase64(l_comment) from lineitem limit 1") {
checkOperatorMatch[ProjectExecTransformer]
}
}
}
3 changes: 2 additions & 1 deletion cpp/velox/substrait/SubstraitParser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,8 @@ std::unordered_map<std::string, std::string> SubstraitParser::substraitVeloxFunc
{"bit_and_merge", "bitwise_and_agg_merge"},
{"murmur3hash", "hash_with_seed"},
{"modulus", "mod"}, /*Presto functions.*/
{"date_format", "format_datetime"}};
{"date_format", "format_datetime"},
{"unbase64", "from_base64"}};

const std::unordered_map<std::string, std::string> SubstraitParser::typeMap_ = {
{"bool", "BOOLEAN"},
Expand Down
2 changes: 1 addition & 1 deletion docs/velox-backend-support-progress.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Gluten supports 199 functions. (Draw to right to see all data types)
| translate | | | | | | | | | | | | | | | | | | | | | | |
| trim | trim | trim | S | | | | | | | | | | | S | | | | | | | | |
| ucase, upper | upper | upper | S | | | | | | | | | | | S | | | | | | | | |
| unbase64 | | | | | | | | | | | | | | | | | | | | | | |
| unbase64 | | | S | | | | | | | | | | | | | | | | | | | |
| unhex | | | | | | | | | | | | | | | | | | | | | | |
| upper, ucase | upper | upper | S | | | | | | | | | | | S | | | | | | | | |
| xpath | | | | | | | | | | | | | | | | | | | | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ object ExpressionMappings {
Sig[StringDecode](DECODE),
Sig[Encode](ENCODE),
Sig[Uuid](UUID),
Sig[UnBase64](UNBASE64),

// URL functions
Sig[ParseUrl](PARSE_URL),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ object ExpressionNames {
final val DECODE = "decode"
final val ENCODE = "encode"
final val UUID = "uuid"
final val UNBASE64 = "unbase64"

// URL functions
final val PARSE_URL = "parse_url"
Expand Down

0 comments on commit b63adf2

Please sign in to comment.