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

Implement withField and dropField for struct types #813

Open
Tracked by #1043
andygrove opened this issue Aug 12, 2024 · 3 comments
Open
Tracked by #1043

Implement withField and dropField for struct types #813

andygrove opened this issue Aug 12, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@andygrove
Copy link
Member

What is the problem the feature request solves?

See documenttion for more details:

https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.Column.withField.html

https://spark.apache.org/docs/latest/api/python/reference/pyspark.sql/api/pyspark.sql.Column.dropFields.html

Describe the potential solution

No response

Additional context

No response

@andygrove andygrove added enhancement New feature or request good first issue Good for newcomers labels Aug 12, 2024
@dharanad
Copy link

take

@Kimahriman
Copy link
Contributor

I believe these are purely used for analysis, and end up just becoming named_struct expressions in the physical plan, so they're probably already supported

@eejbyfeldt
Copy link
Contributor

My understanding is the same as @Kimahriman
that both of these are implemented in terms of UpdateFields which are replaced in the spark Analyzer by the rule ReplaceUpdateFieldsExpression https://github.com/apache/spark/blob/v3.5.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/UpdateFields.scala#L79-L87 and based on https://github.com/apache/spark/blob/v3.5.2/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala#L746-L757 it looks like it is replace by CreateNamedStruct expression and should therefore be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants