Repository navigation
fix QUART/MEDIAN/MIN/MAX on number/date/string - #1156
Merged
mathiasrw merged 3 commits intoJan 17, 2020
Merged
Conversation
| colexp + | ||
| ');' + | ||
| post | ||
| pre + 'if ((y=' + colexp + ") > g['" + colas + "']) g['" + colas + "'] = y;" + post |
Contributor
Author
There was a problem hiding this comment.
I used y here assuming it is intended to be a temporary variable (as far as I can tell from how it is used in AVG) so colexp don't get evaluated twice.
Member
|
You are soooo deep into the details. Wow. I love it. even a nice test case. Perfect. |
Codecov Report
@@ Coverage Diff @@
## develop #1156 +/- ##
===========================================
- Coverage 41.53% 41.53% -0.01%
===========================================
Files 2 2
Lines 21012 21004 -8
Branches 6295 6291 -4
===========================================
- Hits 8727 8723 -4
+ Misses 12285 12281 -4
Continue to review full report at Codecov.
|
Member
|
Released as version 0.5.4 💟 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix MIN/MAX and GREATEST/LEAST to work on date and string by actively compare with
<and>instead ofMath.minandMath.max. This is commonly supported by other SQL engine: https://www.w3resource.com/sql/aggregate-functions/min-function.phpCurrently,
MIN/MAXworks for Date but the data type changes to number, which is not what user would expect.Fix QUART/MEDIAN to use custom comparator with
<and>. When comparator is not supplied, Javascript coerce arguments to string:Enabled skipped tests on these functions and update tests for new and correct behaviors (for example, median of numbers between 1 and 10000 should be 5000 not 5499.) add test from #104
p.s. some files got auto-formatted, specifically for
423groupby.js, I only changed 'MIN' and 'MAX' implementation.closes #411