iffyio commented on code in PR #2480:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2480#discussion_r3946595560
##########
tests/sqlparser_redshift.rs:
##########
@@ -557,3 +557,17 @@ fn parse_unpivot_expression() {
fn test_interval_as_column_name() {
redshift().verified_stmt("SELECT * FROM table_name WHERE interval = 78");
}
+
+#[test]
+fn parse_approximate_percentile_disc() {
+ redshift().one_statement_parses_to(
+ r#"SELECT TOP 10 date.caldate,
+COUNT(totalprice), SUM(totalprice),
+APPROXIMATE PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY totalprice)
+FROM listing
+JOIN date ON listing.dateid = date.dateid
+GROUP BY date.caldate
+ORDER BY 3 DESC"#,
+ "SELECT TOP 10 date.caldate, COUNT(totalprice), SUM(totalprice),
APPROXIMATE PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY totalprice) FROM
listing JOIN date ON listing.dateid = date.dateid GROUP BY date.caldate ORDER
BY 3 DESC",
Review Comment:
lets simplify this test input so that its clear what's being tested. also we
should use verified_stmt
--
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]