dtenedor opened a new pull request, #48047:
URL: https://github.com/apache/spark/pull/48047

   ### What changes were proposed in this pull request?
   
   This PR adds SQL pipe syntax support for the SELECT operator.
   
   For example:
   
   ```
   create table t(x int, y string) using csv;
   insert into t values (0, 'abc'), (1, 'def');
   
   table t
   |> select x, y
   
   0    abc
   1    def
   
   table t
   |> select x, y
   |> select x + length(y) as z
   
   3
   4
   
   (select * from t union all select * from t)
   |> select x + length(y) as result
   
   3
   3
   4
   4
   
   table t
   |> select sum(x) as result
   
   Error: aggrgate functions are not allowed in the pipe operator |> SELECT 
clause; please use the |> AGGREGATE clause instead
   ```
   
   ### Why are the changes needed?
   
   The SQL pipe operator syntax will let users compose queries in a more 
flexible fashion.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes, see above.
   
   ### How was this patch tested?
   
   This PR adds a few unit test cases, but mostly relies on golden file test 
coverage. I did this to make sure the answers are correct as this feature is 
implemented and also so we can look at the analyzer output plans to ensure they 
look right as well.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to