doupache commented on issue #12206:
URL: https://github.com/apache/datafusion/issues/12206#issuecomment-2314475946

   +1 
   
   VLDB 2024 has an interesting paper from Google [SQL Has Problems. We Can Fix 
Them: Pipe Syntax In 
SQL](https://research.google/pubs/sql-has-problems-we-can-fix-them-pipe-syntax-in-sql/).
   
   One of the key pain points the paper addresses is making the "reading flow 
match the logical execution flow." The proposed function chaining is a 
lightweight mechanism, essentially a syntactic sugar to avoid deeply nested 
function calls in SELECT items . 
   
   It’s somewhat similar to how Promises in JavaScript help solve callback hell.
   
   example from [DuckDB 
blog](https://duckdb.org/2023/08/23/even-friendlier-sql.html)
   
   without function chaining 
   ```sql 
   SELECT 
        concat(
             list_aggr(
                  string_split(
                       upper('Make it stop'),
                  ' '),
             'string_agg','.'),
        '.') AS oof;
   ```
   
   function chaining 
   ```sql
   SELECT 
        ('Make it so')
             .upper()
             .string_split(' ')
             .list_aggr('string_agg','.')
             .concat('.') AS im_not_messing_around_number_one;
   ```
   
   If we reach a consensus on this, I'd like to work on it. 
    I have a [slight improvement](https://github.com/duckdb/duckdb/pull/7313) 
on DuckDB's function chaining 
   
   
   


-- 
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