iffyio commented on code in PR #2480:
URL:
https://github.com/apache/datafusion-sqlparser-rs/pull/2480#discussion_r3975843869
##########
tests/sqlparser_redshift.rs:
##########
@@ -557,3 +557,22 @@ 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() {
+ let dialects = all_dialects_where(|d|
d.supports_approximate_percentile_disc());
+ dialects.verified_stmt(
+ "SELECT APPROXIMATE PERCENTILE_DISC(0.5) WITHIN GROUP (ORDER BY
totalprice)",
+ );
+}
+
+#[test]
+fn parse_approximate_percentile_disc_as_column_alias() {
Review Comment:
```suggestion
```
we can merge the tests
##########
src/dialect/mod.rs:
##########
@@ -598,6 +598,11 @@ pub trait Dialect: Debug + Any {
None
}
+ /// Does the dialect support the `APPROXIMATE PERCENTILE_DISC` function
syntax?
+ fn supports_approximate_percentile_disc(&self) -> bool {
Review Comment:
can we add a link to the docs where the syntax is described? both here and
in the redshift override? Otherwise it would be hard to know what it does
without reading the code
--
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]