Skip to content

Commit eaa4506

Browse files
committed
feat: support concat
1 parent 5372de3 commit eaa4506

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

spark/src/main/scala/org/apache/comet/serde/QueryPlanSerde.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ object QueryPlanSerde extends Logging with CometExprShim {
163163
classOf[BitLength] -> CometScalarFunction("bit_length"),
164164
classOf[Chr] -> CometScalarFunction("char"),
165165
classOf[ConcatWs] -> CometScalarFunction("concat_ws"),
166+
classOf[Concat] -> CometScalarFunction("concat"),
166167
classOf[Contains] -> CometScalarFunction("contains"),
167168
classOf[EndsWith] -> CometScalarFunction("ends_with"),
168169
classOf[InitCap] -> CometInitCap,

spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3204,4 +3204,15 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
32043204
}
32053205
}
32063206

3207+
test("test concat function - strings") {
3208+
withTable("t1") {
3209+
sql(
3210+
"create table t1 using parquet as select uuid() c1, uuid() c2, uuid() c3, uuid() c4, cast(null as string) c5 from range(10)")
3211+
checkSparkAnswerAndOperator("select concat(c1, c2) AS x FROM t1")
3212+
checkSparkAnswerAndOperator("select concat(c1, c2, c3) AS x FROM t1")
3213+
checkSparkAnswerAndOperator("select concat(c1, c2, c3, c5) AS x FROM t1")
3214+
//checkSparkAnswerAndOperator("select concat(concat(c1, c2, c3), concat(c1, c3)) AS x FROM t1")
3215+
}
3216+
}
3217+
32073218
}

0 commit comments

Comments
 (0)