alamb opened a new pull request, #15929:
URL: https://github.com/apache/datafusion/pull/15929

   ## Which issue does this PR close?
   
   - Closes https://github.com/apache/datafusion/issues/15927
   
   ## Rationale for this change
   
   See https://github.com/apache/datafusion/issues/15927
   
   TLDR is that we improved the syntax for APPROX_PERCENTILE_CONT but did not 
update the corresponding benchmark query
   
   ## What changes are included in this PR?
   
   Update benchmark query, add tests
   
   I also verified the new syntax gets the same answer as the old syntax in 
datafusion 47:
   
   DataFusion 47 with old query:
   
   ```sql
   (venv) andrewlamb@Andrews-MacBook-Pro-2:~/Downloads$ 
~/Software/datafusion-cli/datafusion-cli-47.0.0
   DataFusion CLI v47.0.0
   > SELECT "ClientIP", "WatchID",  COUNT(*) c, MIN("ResponseStartTiming") 
tmin, APPROX_PERCENTILE_CONT("ResponseStartTiming", 0.95) tp95, 
MAX("ResponseStartTiming") tmax
   FROM 'hits.parquet'
   WHERE "JavaEnable" = 0 -- filters to 32M of 100M rows
   GROUP BY  "ClientIP", "WatchID"
   HAVING c > 1
   ORDER BY tp95 DESC
   LIMIT 10;
   +-------------+---------------------+---+------+------+------+
   | ClientIP    | WatchID             | c | tmin | tp95 | tmax |
   +-------------+---------------------+---+------+------+------+
   | 1611957945  | 6655575552203051303 | 2 | 0    | 0    | 0    |
   | -1402644643 | 8566928176839891583 | 2 | 0    | 0    | 0    |
   +-------------+---------------------+---+------+------+------+
   2 row(s) fetched.
   Elapsed 5.360 seconds.
   ```
   
   main with new query:
   ```sql
   DataFusion CLI v47.0.0
   > SELECT "ClientIP", "WatchID",  COUNT(*) c, MIN("ResponseStartTiming") 
tmin, APPROX_PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY 
"ResponseStartTiming") tp95, MAX("ResponseStartTiming") tmax FROM 'hits' WHERE 
"JavaEnable" = 0 GROUP BY  "ClientIP", "WatchID" HAVING c > 1 ORDER BY tp95 
DESC LIMIT 10;
   +-------------+---------------------+---+------+------+------+
   | ClientIP    | WatchID             | c | tmin | tp95 | tmax |
   +-------------+---------------------+---+------+------+------+
   | 1611957945  | 6655575552203051303 | 2 | 0    | 0    | 0    |
   | -1402644643 | 8566928176839891583 | 2 | 0    | 0    | 0    |
   +-------------+---------------------+---+------+------+------+
   2 row(s) fetched.
   Elapsed 4.684 seconds.
   ```
   
   ## Are these changes tested?
   Yes
   <!--
   We typically require tests for all PRs in order to:
   1. Prevent the code from being accidentally broken by subsequent changes
   2. Serve as another way to document the expected behavior of the code
   
   If tests are not included in your PR, please explain why (for example, are 
they covered by existing tests)?
   -->
   
   ## Are there any user-facing changes?
   
   <!--
   If there are user-facing changes then we may require documentation to be 
updated before approving the PR.
   -->
   
   <!--
   If there are any breaking changes to public APIs, please add the `api 
change` label.
   -->
   


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

Reply via email to