From f64561d3d744584d31faea7cae72be78078bced2 Mon Sep 17 00:00:00 2001 From: Ruifeng Zheng Date: Mon, 26 Aug 2024 12:24:03 +0800 Subject: [PATCH] init --- python/pyspark/sql/connect/functions/builtin.py | 4 ++-- python/pyspark/sql/functions/builtin.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/python/pyspark/sql/connect/functions/builtin.py b/python/pyspark/sql/connect/functions/builtin.py index e28c9815a83c..db3680f5cd42 100644 --- a/python/pyspark/sql/connect/functions/builtin.py +++ b/python/pyspark/sql/connect/functions/builtin.py @@ -1223,7 +1223,7 @@ def percentile( def percentile_approx( col: "ColumnOrName", percentage: Union[Column, float, Sequence[float], Tuple[float]], - accuracy: Union[Column, float] = 10000, + accuracy: Union[Column, int] = 10000, ) -> Column: percentage = lit(list(percentage)) if isinstance(percentage, (list, tuple)) else lit(percentage) return _invoke_function_over_columns("percentile_approx", col, percentage, lit(accuracy)) @@ -1235,7 +1235,7 @@ def percentile_approx( def approx_percentile( col: "ColumnOrName", percentage: Union[Column, float, Sequence[float], Tuple[float]], - accuracy: Union[Column, float] = 10000, + accuracy: Union[Column, int] = 10000, ) -> Column: percentage = lit(list(percentage)) if isinstance(percentage, (list, tuple)) else lit(percentage) return _invoke_function_over_columns("approx_percentile", col, percentage, lit(accuracy)) diff --git a/python/pyspark/sql/functions/builtin.py b/python/pyspark/sql/functions/builtin.py index 387a039758f1..bae80c59c578 100644 --- a/python/pyspark/sql/functions/builtin.py +++ b/python/pyspark/sql/functions/builtin.py @@ -6339,7 +6339,7 @@ def percentile( def percentile_approx( col: "ColumnOrName", percentage: Union[Column, float, Sequence[float], Tuple[float]], - accuracy: Union[Column, float] = 10000, + accuracy: Union[Column, int] = 10000, ) -> Column: """Returns the approximate `percentile` of the numeric column `col` which is the smallest value in the ordered `col` values (sorted from least to greatest) such that no more than `percentage` @@ -6360,7 +6360,7 @@ def percentile_approx( When percentage is an array, each value of the percentage array must be between 0.0 and 1.0. In this case, returns the approximate percentile array of column col at the given percentage array. - accuracy : :class:`~pyspark.sql.Column` or float + accuracy : :class:`~pyspark.sql.Column` or int is a positive numeric literal which controls approximation accuracy at the cost of memory. Higher value of accuracy yields better accuracy, 1.0/accuracy is the relative error of the approximation. (default: 10000). @@ -6397,7 +6397,7 @@ def percentile_approx( def approx_percentile( col: "ColumnOrName", percentage: Union[Column, float, Sequence[float], Tuple[float]], - accuracy: Union[Column, float] = 10000, + accuracy: Union[Column, int] = 10000, ) -> Column: """Returns the approximate `percentile` of the numeric column `col` which is the smallest value in the ordered `col` values (sorted from least to greatest) such that no more than `percentage` @@ -6414,7 +6414,7 @@ def approx_percentile( When percentage is an array, each value of the percentage array must be between 0.0 and 1.0. In this case, returns the approximate percentile array of column col at the given percentage array. - accuracy : :class:`~pyspark.sql.Column` or float + accuracy : :class:`~pyspark.sql.Column` or int is a positive numeric literal which controls approximation accuracy at the cost of memory. Higher value of accuracy yields better accuracy, 1.0/accuracy is the relative error of the approximation. (default: 10000).