alamb commented on code in PR #12871:
URL: https://github.com/apache/datafusion/pull/12871#discussion_r1805397861


##########
datafusion/functions-aggregate/src/regr.rs:
##########
@@ -135,6 +123,148 @@ pub enum RegrType {
     SXY,
 }
 
+impl RegrType {
+    /// return the documentation for the `RegrType`
+    fn documentation(&self) -> Option<&Documentation> {
+        get_regr_docs().get(self)
+    }
+}
+
+static DOCUMENTATION: OnceLock<HashMap<RegrType, Documentation>> = 
OnceLock::new();
+fn get_regr_docs() -> &'static HashMap<RegrType, Documentation> {
+    DOCUMENTATION.get_or_init(|| {
+        let mut hash_map = HashMap::new();
+        hash_map.insert(
+            RegrType::Slope,
+            Documentation::builder()
+                .with_doc_section(DOC_SECTION_STATISTICAL)
+                .with_description(
+                    "Returns the slope of the linear regression line for 
non-null pairs in aggregate columns. \
+                    Given input column Y and X: regr_slope(Y, X) returns the 
slope (k in Y = k*X + b) using minimal RSS fitting.",
+                )
+                .with_syntax_example("regr_slope(expression_y, expression_x)")
+                .with_standard_argument("expression_y", "Expression")

Review Comment:
   Fixed. Thank you



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