Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -915,6 +915,9 @@ object QueryPlanSerde extends Logging with CometExprShim {
case l @ Length(child) if child.dataType == BinaryType =>
withInfo(l, "Length on BinaryType is not supported")
None
case r @ Reverse(child) if child.dataType.isInstanceOf[ArrayType] =>
withInfo(r, "Reverse on ArrayType is not supported")
None
case expr =>
QueryPlanSerde.exprSerdeMap.get(expr.getClass) match {
case Some(handler) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3122,4 +3122,12 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
}
}

test("test reverse function") {
withTable("t1") {
sql("create table t1 using parquet as select sequence(id, 10) as c1 from range(10)")
// FIXME: Change checkSparkAnswer to checkSparkAnswerAndOperator after resolving
// https://github.com/apache/datafusion-comet/issues/2478
checkSparkAnswer("select reverse(c1) AS x FROM t1 ORDER BY c1")
}
}
}
Loading