Skip to content

Commit

Permalink
add uts
Browse files Browse the repository at this point in the history
  • Loading branch information
taiyang-li committed Sep 3, 2024
1 parent 22e1fd4 commit f9c9378
Showing 1 changed file with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,26 @@ class GlutenFunctionValidateSuite extends GlutenClickHouseWholeStageTransformerS
}

test("test function array_except") {
val sql =
"""
|SELECT array_except(array(id, id+1, id+2), array(id+2, id+3))
|FROM RANGE(10)
|""".stripMargin
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
}

test("test functions unix_seconds/unix_date/unix_millis/unix_micros") {
val sql = """
|SELECT array_except(array(id, id+1, id+2), array(id+2, id+3))
|FROM RANGE(10)
|SELECT
| id,
| unix_seconds(cast(concat('2024-09-03 17:23:1',
| cast(id as string)) as timestamp)),
| unix_date(cast(concat('2024-09-1', cast(id as string)) as date)),
| unix_millis(cast(concat('2024-09-03 17:23:10.11',
| cast(id as string)) as timestamp)),
| unix_micros(cast(concat('2024-09-03 17:23:10.12345',
| cast(id as string)) as timestamp))
|FROM range(10)
|""".stripMargin
runQueryAndCompare(sql)(checkGlutenOperatorMatch[ProjectExecTransformer])
}
Expand Down

0 comments on commit f9c9378

Please sign in to comment.