-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Export has duplicates #47
Comments
Maybe we can use the value set in the However, I think doing so will be a change in behavior. Some of our users expect what they see on the screen would be in the same order when it was exported. I am in favor of using lazyById but it should not be the default behavior. We can put it config I guess? |
I was actually thinking the opposite...
The |
Can you provide snippets to reproduce the duplicates? I asked around my users and they haven't encountered any duplicates yet. Largest export so far is ~200k. |
I'm not allowed to share any code snippets, but I've created a demo: Be sure to run UserSeeder. if you try to export users, you will actually see the duplicates in the excel spreadsheet. Obviously, if you lower chunk size, you will see more duplicates. |
I tested your demo app using SQLite. I was able to filter 28 records and export yields to the same result. Filtered 1 and all 1k records, and got the expected results. Might be pgsql specific issue? Will try to set up a pgsql later. |
@yajra $chunkSize has to be smaller than total number of records in filteredQuery. I suggest running |
This issue is stale because it has been open for 30 days with no activity. |
@uchajk maybe orderFixed option would help in this case? Not tested but maybe you can add a |
Yeah sounds like it might. I'll need to find some time to test this. |
Export yields unexpected results. We see multiple duplicates in the exported excel file.
The problem stems from this line:
laravel-datatables-export/src/Jobs/DataTableExportJob.php
Line 122 in 4e7cbcb
Notice that if the filtered query is not ordered by id (or any unique column), the order of the rows might differ between the calls.
I would suggest using lazyById, but then we would have to pass the name of the column we want to use for lazyById.
The text was updated successfully, but these errors were encountered: