Skip to content

Commit

Permalink
[VL] Add spark monotonically_increasing_id function support (#4954)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaoyangxiaozhu authored Mar 18, 2024
1 parent 91d0275 commit 9bacf0f
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ object CHExpressionUtil {
ARRAY_EXCEPT -> DefaultValidator(),
ARRAY_REPEAT -> DefaultValidator(),
DATE_FROM_UNIX_DATE -> DefaultValidator(),
MONOTONICALLY_INCREASING_ID -> DefaultValidator(),
SKEWNESS -> DefaultValidator()
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,13 @@ class VeloxFunctionsValidateSuite extends VeloxWholeStageTransformerSuite {
}
}

test("Test monotonically_increasing_id function") {
runQueryAndCompare("""SELECT monotonically_increasing_id(), l_orderkey
| from lineitem limit 1""".stripMargin) {
checkOperatorMatch[ProjectExecTransformer]
}
}

test("Test hex function") {
runQueryAndCompare("SELECT hex(l_partkey), hex(l_shipmode) FROM lineitem limit 1") {
checkOperatorMatch[ProjectExecTransformer]
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 @@ -416,7 +416,7 @@ Gluten supports 199 functions. (Draw to right to see all data types)
| java_method | | | | | | | | | | | | | | | | | | | | | | |
| least | least | least | S | | | | | | S | S | S | S | S | | | | | | | | | |
| md5 | md5 | | S | | | S | | | | | | | | | | | | | | | | |
| monotonically_increasing_id | | | | | | | | | | | | | | | | | | | | | | |
| monotonically_increasing_id | | | S | | | | | | | | | | | | | | | | | | | |
| nanvl | | | S | | | | | | | | | | | | | | | | | | | |
| nvl | | | | | | | | | | | | | | | | | | | | | | |
| nvl2 | | | | | | | | | | | | | | | | | | | | | | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ object ExpressionMappings {
Sig[CheckOverflow](CHECK_OVERFLOW),
Sig[MakeDecimal](MAKE_DECIMAL),
Sig[PromotePrecision](PROMOTE_PRECISION),
Sig[MonotonicallyIncreasingID](MONOTONICALLY_INCREASING_ID),
// Decimal
Sig[UnscaledValue](UNSCALED_VALUE)
) ++ SparkShimLoader.getSparkShims.expressionMappings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ object ExpressionNames {
final val CHECK_OVERFLOW = "check_overflow"
final val MAKE_DECIMAL = "make_decimal"
final val PROMOTE_PRECISION = "promote_precision"
final val MONOTONICALLY_INCREASING_ID = "monotonically_increasing_id"

// Directly use child expression transformer
final val KNOWN_FLOATING_POINT_NORMALIZED = "known_floating_point_normalized"
Expand Down

0 comments on commit 9bacf0f

Please sign in to comment.