abhishekrb19 commented on code in PR #16277:
URL: https://github.com/apache/druid/pull/16277#discussion_r1563058032
##########
docs/development/extensions-core/stats.md:
##########
@@ -125,8 +126,24 @@ To acquire standard deviation from variance, user can use
"stddev" post aggregat
}
```
+#### Druid SQL
Review Comment:
It would be preferable to move the SQL query section before the native query
section since SQL is more widely used and familiar to users. Same suggestion
for all the SQL sections in this page.
##########
docs/development/extensions-core/stats.md:
##########
@@ -181,3 +206,14 @@ To acquire standard deviation from variance, user can use
"stddev" post aggregat
]
}
```
+
+#### Druid SQL
+
+```SQL
+SELECT
+ alias,
+ VARIANCE("index") AS index_var
+FROM "testing"
+WHERE TIME_IN_INTERVAL(__time, '2016-03-06T00:00:00/2016-03-06T23:59:59')
Review Comment:
End date is exclusive, so I would think this should be start of the next
day? Same for the native query:
```suggestion
WHERE TIME_IN_INTERVAL(__time, '2016-03-06/2016-03-07')
```
##########
docs/development/extensions-core/stats.md:
##########
@@ -154,8 +171,16 @@ To acquire standard deviation from variance, user can use
"stddev" post aggregat
}
```
+#### Druid SQL
+
+```SQL
+There is no equivalent SQL for this query.
Review Comment:
Perhaps move this text outside the sql codeblock?
##########
docs/development/extensions-core/stats.md:
##########
@@ -125,8 +126,24 @@ To acquire standard deviation from variance, user can use
"stddev" post aggregat
}
```
+#### Druid SQL
+
+```SQL
+SELECT
+ DATE_TRUNC('day', __time),
+ VARIANCE("index_var")
+FROM
+ "testing"
+WHERE
+ TIME_IN_INTERVAL(__time, '2013-03-01T00:00:00.000/2016-03-20T00:00:00.000')
+GROUP BY
+ DATE_TRUNC('day', __time)
Review Comment:
Small simplification:
```suggestion
SELECT
DATE_TRUNC('day', __time),
VARIANCE("index_var") AS index_var
FROM "testing"
WHERE TIME_IN_INTERVAL(__time, '2013-03-01/2016-03-20')
GROUP BY 1
```
--
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]