Skip to content

Commit

Permalink
support function arrays_zip
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Sep 9, 2024
1 parent 088c61a commit 506c0a7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ object CHExpressionUtil {
ENCODE -> EncodeDecodeValidator(),
ARRAY_REPEAT -> DefaultValidator(),
ARRAY_REMOVE -> DefaultValidator(),
ARRAYS_ZIP -> DefaultValidator(),
DATE_FROM_UNIX_DATE -> DefaultValidator(),
MONOTONICALLY_INCREASING_ID -> DefaultValidator(),
SPARK_PARTITION_ID -> DefaultValidator(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,13 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS
| cast(id as string)) as timestamp)),
| unix_micros(cast(concat('2024-09-03 17:23:10.12345',
| cast(id as string)) as timestamp))
|""".stripMargin
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
}

test("test function arrays_zip") {
val sql = """
|SELECT arrays_zip(array(id, id+1, id+2), array(id, id-1, id-2))
|FROM range(10)
|""".stripMargin
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Shuffle, shuffle, arrayShuffle);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Range, range, range);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Flatten, flatten, sparkArrayFlatten);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(ArrayJoin, array_join, sparkArrayJoin);
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(ArrayZip, array_zip, arrayZipUnaligned);

// map functions
REGISTER_COMMON_SCALAR_FUNCTION_PARSER(Map, map, map);
Expand Down

0 comments on commit 506c0a7

Please sign in to comment.