alamb commented on issue #16453:
URL: https://github.com/apache/datafusion/issues/16453#issuecomment-4834662125

   How about rewriting
   
   ```sql
   SELECT window_start, window_end, window_duration, avg(value) FROM t GROUP BY 
session_window(ts, INTERVAL '30' SECOND);
   ```
   
   Into a UDF that returns a struct
   
   ```sql
   SELECT augmented_avg(ts, value) FROM t GROUP BY session_window(ts, INTERVAL 
'30' SECOND);
   ```
   
   Then the augmented avg could return a struct like
   
   ```json
   { 
     window_start: ts,
     window_end: ts,
     window_duration: duration,
     avg_value: ..
   }
   ```
   


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