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

[SPARK-41061][CONNECT] Support SelectExpr which applies Projection by expressions in Strings in Connect DSL #38573

Closed
wants to merge 2 commits into from

Conversation

amaliujia
Copy link
Contributor

What changes were proposed in this pull request?

  1. support def selectExpr(exprs: String*) in Connect DSL.
  2. Server side supports translation Expressions in Strings.

Why are the changes needed?

Improve API coverage.

Does this PR introduce any user-facing change?

NO

How was this patch tested?

UT

@amaliujia
Copy link
Contributor Author

R: @cloud-fan

@cloud-fan
Copy link
Contributor

shall we add the python client API in this PR as well?

@amaliujia
Copy link
Contributor Author

@cloud-fan the python side is blocked on how to build the expression protos: https://github.com/apache/spark/blob/master/python/pyspark/sql/connect/column.py

Right now there is a mixed of ColumnRef, str as UnresolvedAttribute, etc. without a clear API for different cases. For example str could be expression string or UnresolvedAttribute, but current column.py only consider UnresolvedAttribute case. I am thinking how to refactor on python side to have the expression system to easy build expression proto.

@cloud-fan
Copy link
Contributor

thanks, merging to master!

@cloud-fan cloud-fan closed this in 0b8ab32 Nov 9, 2022
@amaliujia
Copy link
Contributor Author

I will send several PR to improve the expressions on Python side to unblock relevant API implementation. This is the first one: #38586

SandishKumarHN pushed a commit to SandishKumarHN/spark that referenced this pull request Dec 12, 2022
… expressions in Strings in Connect DSL

### What changes were proposed in this pull request?

1. support `def selectExpr(exprs: String*)` in Connect DSL.
2. Server side supports translation Expressions in Strings.

### Why are the changes needed?

Improve API coverage.

### Does this PR introduce _any_ user-facing change?

NO

### How was this patch tested?

UT

Closes apache#38573 from amaliujia/select_expr_connect_dsl.

Authored-by: Rui Wang <rui.wang@databricks.com>
Signed-off-by: Wenchen Fan <wenchen@databricks.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants