-
Notifications
You must be signed in to change notification settings - Fork 5.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
executor: use EncodeBytes in countOriginDistinct #10107
Conversation
ae8ee54
to
78b1c7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -329,7 +331,7 @@ func (e *countOriginalWithDistinct) evalAndEncode( | |||
if err != nil || isNull { | |||
break | |||
} | |||
encodedBytes = appendString(encodedBytes, buf, val) | |||
encodedBytes = codec.EncodeBytes(encodedBytes, hack.Slice(val)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like appendJSON
has risk as well theoretically?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll change it.
But it a little difficult to write tests for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov Report
@@ Coverage Diff @@
## master #10107 +/- ##
===============================================
- Coverage 77.952% 77.9509% -0.0012%
===============================================
Files 407 407
Lines 83264 83296 +32
===============================================
+ Hits 64906 64930 +24
- Misses 13549 13555 +6
- Partials 4809 4811 +2 |
What problem does this PR solve?
fix issue #10099
What is changed and how it works?
Use EncodeBytes to encode string values in countOriginalWithDistinct.
Before this commit, string values are encoded with true values.
e.g.
encode("1", "122") --> "1122"
encode("11", "22") --> "1222"
These are not comparable.
Check List
Tests
Code changes
Side effects
N/A
Related changes