Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Support array_join #1290

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

erenavsarogullari
Copy link
Member

Which issue does this PR close?

Related to Epic: #1042
array_join: select array_join(array('hello', '-', 'world'), ' ') => hello - world
DataFusion' s array_join function is alias of array_to_string function:
https://datafusion.apache.org/user-guide/sql/scalar_functions.html#array-join

Rationale for this change

Defined under Epic: #1042

What changes are included in this PR?

planner.rs: Created DataFusion array_join physical expression from Spark physical expression with return type: DataType::Utf8,
expr.proto: array_join message has been added (array_intersect is 62),
QueryPlanSerde.scala: array_join pattern matching case has been added,
CometExpressionSuite.scala: A new UT has been added for array_join function.

How are these changes tested?

A new UT has been added and first query result is as follows:
Query Result II

@@ -86,6 +86,7 @@ message Expr {
ArrayInsert array_insert = 59;
BinaryExpr array_contains = 60;
BinaryExpr array_remove = 61;
BinaryExpr array_join = 63;
Copy link
Member

Choose a reason for hiding this comment

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

Why not use 62?

Copy link
Member Author

@erenavsarogullari erenavsarogullari Jan 15, 2025

Choose a reason for hiding this comment

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

I have another PR for array_intersect and it uses 62. I think array_intersect can go first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants