Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -708,4 +708,14 @@ class CometArrayExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelp
}
}
}

test("test reverse function") {
withTable("t1") {
sql(
"create table t1 using parquet as select sequence(id, id) as c1 from range(10)")
// FIXME: Change checkSparkAnswer to checkSparkAnswerAndOperator after resolving
// https://github.com/apache/datafusion-comet/issues/2476
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this PR closes #2476, could you create a new issue to track adding support for ArrayType input in reverse?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Filed a new issue #2478 for tracking reverse function with ArrayType input support.

checkSparkAnswer("select reverse(c1) AS x FROM t1 ORDER BY c1")
}
}
}
Loading