You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support WITHIN GROUP syntax to standardize certain existing aggregate functions (apache#13511)
* Add within group variable to aggregate function and arguments
* Support within group and disable null handling for ordered set aggregate functions (apache#13511)
* Refactored function to match updated signature
* Modify proto to support within group clause
* Modify physical planner and accumulator to support ordered set aggregate function
* Support session management for ordered set aggregate functions
* Align code, tests, and examples with changes to aggregate function logic
* Ensure compatibility with new `within_group` and `order_by` handling.
* Adjust tests and examples to align with the new logic.
* Fix typo in existing comments
* Enhance test
* Add test cases for changed signature
* Update signature in docs
* Fix bug : handle missing within_group when applying children tree node
* Change the signature of approx_percentile_cont for consistency
* Add missing within_group for expr display
* Handle edge case when over and within group clause are used together
* Apply clippy advice: avoids too many arguments
* Add new test cases using descending order
* Apply cargo fmt
* Revert unintended submodule changes
* Apply prettier guidance
* Apply doc guidance by update_function_doc.sh
* Rollback WITHIN GROUP and related logic after converting it into expr
* Make it not to handle redundant logic
* Rollback ordered set aggregate functions from session to save same info in udf itself
* Convert within group to order by when converting sql to expr
* Add function to determine it is ordered-set aggregate function
* Rollback within group from proto
* Utilize within group as order by in functions-aggregate
* Apply clippy
* Convert order by to within group
* Apply cargo fmt
* Remove plain line breaks
* Remove duplicated column arg in schema name
* Refactor boolean functions to just return primitive type
* Make within group necessary in the signature of existing ordered set aggr funcs
* Apply cargo fmt
* Support a single ordering expression in the signature
* Apply cargo fmt
* Add dataframe function test cases to verify descending ordering
* Apply cargo fmt
* Apply code reviews
* Uses order by consistently after done with sql
* Remove redundant comment
* Serve more clear error msg
* Handle error cases in the same code block
* Update error msg in test as corresponding code changed
* fix
---------
Co-authored-by: Jay Zhan <jayzhan211@gmail.com>
Copy file name to clipboardExpand all lines: datafusion/functions-aggregate/src/approx_median.rs
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ make_udaf_expr_and_func!(
45
45
/// APPROX_MEDIAN aggregate expression
46
46
#[user_doc(
47
47
doc_section(label = "Approximate Functions"),
48
-
description = "Returns the approximate median (50th percentile) of input values. It is an alias of `approx_percentile_cont(x, 0.5)`.",
48
+
description = "Returns the approximate median (50th percentile) of input values. It is an alias of `approx_percentile_cont(0.5) WITHIN GROUP (ORDER BY x)`.",
49
49
syntax_example = "approx_median(expression)",
50
50
sql_example = r#"```sql
51
51
> SELECT approx_median(column_name) FROM table_name;
0 commit comments