forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-49565][SQL] Improve auto-generated expression aliases with pip…
…e SQL operators ### What changes were proposed in this pull request? This RP improves auto-generated expression aliases with pipe SQL operators. For example, consider the pipe SQL syntax query: ``` table t |> extend 1 ``` Previously, the analyzed plan was: ``` Project [x#x, y#x, pipeexpression(1, false, EXTEND) AS pipeexpression(1)#x] +- SubqueryAlias spark_catalog.default.t +- Relation spark_catalog.default.t[x#x,y#x] csv ``` After this PR, it is: ``` Project [x#x, y#x, pipeexpression(1, false, EXTEND) AS 1#x] +- SubqueryAlias spark_catalog.default.t +- Relation spark_catalog.default.t[x#x,y#x] csv ``` Note that the output aliases visible in the resulting DataFrame for the query derive from the `AS <alias>` part of the analyzed plans shown. ### Why are the changes needed? This improves the user experience with pipe SQL syntax. ### Does this PR introduce _any_ user-facing change? Yes, see above. ### How was this patch tested? Existing golden file tests update to show the improved aliases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#49245 from dtenedor/fix-pipe-output-aliases. Authored-by: Daniel Tenedorio <[email protected]> Signed-off-by: Wenchen Fan <[email protected]>
- Loading branch information
Showing
6 changed files
with
161 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.