-
Notifications
You must be signed in to change notification settings - Fork 69
fix bug aggregate and fix bug limit #46
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #46 +/- ##
=======================================
Coverage 63.53% 63.53%
=======================================
Files 12 12
Lines 905 905
=======================================
Hits 575 575
Misses 272 272
Partials 58 58
Continue to review full report at Codecov.
|
|
Hi there @mriskyp , thank you for bringing this up.
For this specific case the code is working as expected. I would suggest spliting the issues 1 and 2 into two different issues ( with the last one not really being an issue imo since the added test "0-2" is working as expected ). |
|
Hi there @filipecosta90 , I have params: Then the builder search I have, The debugged query statement stated as below on the paging struct Then I want to show output from the appended redis value on the serialise appended args folder%!(EXTRA string=@is_deleted:false @user_id:[1 1], string=RETURN, int=10, string=folder_id, string=folder_uuid, string=folder_name, string=folder_image_url, string=description, string=folder_status, string=user_id, string=is_deleted, string=created_at, string=updated_at, string=SORTBY, string=folder_id, string=DESC) It returns data redis total 9 caused the limit not appended on the serialise. Then have a look on the code: It means, when I have default offset 0 and not default num 2, Then I try to fix the if statement, meaning if offset is default and num is default too, just return the args without limit. Otherwise, add limit. When do this, the output is expected and the limit finally appended too And the data actual is expected return which is 2 limited data and total counter is 2 |
|
Issue #1 Issue 1 On the cli, it returns the data,
Then I try to running the Golang aggregate based on my redis data specified by the aggregate statement. Then I try to debug when the data is return 1 on the cli, run the code debug aggregate properties struct: Debug: total = len(res) - 1 Then, I fix by if total > 0 for both !hasValidCursor and the partial Now, It returns the expected output same as the cli returns |
sure @filipecosta90 , will be splitting into two diff issues later. |
|
hi there @mriskyp , thank you for the explanation. It's indeed correct the aggregation's issue. Merging your fix and adding more testing. |
-I want to fix two bug:
case when aggregate returns only 1 data grouped, when do aggregate groupby reducer function on CLI, it returns 1 data. but when do in Golang code, it returns empty data, but total = 1, and err is nil. then I try to set if total > 0 , then return aggregate response, total 1, and err nil expected.
case 2: when I want to select limit 0 2, it returns default limit 0 10. then try to debug, found that if limit serialise only shown when (offset != 0 && num != 10). If either offset 0, or num is default, then actual is no limit append on the quest stmt. example limit 0 2. when I fix the if condition, it return exactly limit 0 2 and returns expected response search