alamb commented on code in PR #16927: URL: https://github.com/apache/datafusion/pull/16927#discussion_r2237027984
########## docs/source/user-guide/sql/aggregate_functions.md: ########## @@ -618,6 +618,27 @@ regr_avgx(expression_y, expression_x) - **expression_y**: Dependent variable expression to operate on. Can be a constant, column, or function, and any combination of operators. - **expression_x**: Independent variable expression to operate on. Can be a constant, column, or function, and any combination of operators. +### Exmaple + +consider the table: + +```text ++-----+-------------+ +| day | temperature | +| --- | ----------- | +| 1 | 35 | +| 2 | 36 | +| 3 | NULL | +| 4 | 37 | +| 5 | 38 | ++-----+-------------+ +``` + +```sql +SELECT regr_avgx(total_sales, day) AS avg_day --considering day(x) independent variable Review Comment: this query seems to use a 'daily_sales' table which has a `total_sales` column but the example has `temperature` and `day` columns 🤔 Would it be possible to add the SQL to create the table too for easier review and so people could replicate the examples themselves? Something like ```sql > create table total_sales(day int, temperature int) as values (1,35), (2,36), (3, NULL), (4,37), (5,38); > select * from total_sales; +-----+-------------+ | day | temperature | +-----+-------------+ | 1 | 35 | | 2 | 36 | | 3 | NULL | | 4 | 37 | | 5 | 38 | +-----+-------------+ 5 row(s) fetched. Elapsed 0.001 seconds. ``` -- 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: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org