sandugood opened a new pull request, #22134: URL: https://github.com/apache/datafusion/pull/22134
## Which issue does this PR close? - Closes #22082. ## Rationale for this change In the current DataFusion implementation we can only use a `ScalarValue` as the default value in both LAG and LEAD window functions. That means that user's can't reference other column's values from the table as default value and create various combinations of them (i.e `col1 / col2`). ## What changes are included in this PR? 1. Added `DefaultValue` enum that can be either a `Literal` value or an `Expression` 2. Reimplemented `parse_default_value` function to take `default_value`'s type into consideration 3. Added two functions: `shift_with_array_default` and `evaluate_all_with_ignore_null_and_array_default` for the situations, when `default_value` is of `DefaultValue::Expression` type 4. Added examples for this usecases. ## Are these changes tested? Yes, changes were tested: 1. Added additional unit-tests in the `lead_lag.rs`. 2. Created separate integration-tests in the /tests subdir. ## Are there any user-facing changes? There are user-facing changes in terms of documentation and DataFusion usage (no syntax changes per se). Also, docs were updated -- 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]
