Bug 60786 - [PATCH] Keeping the first rows of an SXSSFSheet in memory for createing pivot table
Summary: [PATCH] Keeping the first rows of an SXSSFSheet in memory for createing pivot...
Status: NEEDINFO
Alias: None
Product: POI
Classification: Unclassified
Component: SXSSF (show other bugs)
Version: 3.16-dev
Hardware: PC All
: P2 enhancement (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2017-02-28 15:05 UTC by Bekő Attila
Modified: 2017-03-24 13:24 UTC (History)
0 users



Attachments
Patch containing modifications of SXSSFSheet and SXSSFWorkbook (4.73 KB, text/plain)
2017-02-28 15:05 UTC, Bekő Attila
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bekő Attila 2017-02-28 15:05:51 UTC
Created attachment 34785 [details]
Patch containing modifications of SXSSFSheet and SXSSFWorkbook

Hello,

Actually if you want to create a pivot table from data stored in a large SXSSFSheet (too large for XSSFSheet) you will get an exception, because row containing pivot header is vanished from memory, you can't access it. With this patch first rows are kept in memory permanently, so  creating pivot table won't cause exception anymore.

I'v added a new constructor to SXSSFWorkbook which will activate this behaviour.

public SXSSFWorkbook(int rowAccessWindowSize, int rowAccessFixedTop)

Second parameter determine how many rows will be kept in memory at the top of the table. The pivot header should be in this area. 

Example: if your header in the 10th row, than you should call constructor with rowAccessFixedTop >= 10 to keep it in memory for pivot table creation.

I hope it's useful for anybody else too.

Regards,
Attila
Comment 1 Dominik Stadler 2017-03-19 08:46:42 UTC
Thanks for the patch, any chance of a unit-test that verifies these changes so they stay in place correctly in the future?
Comment 2 Bekő Attila 2017-03-24 13:24:08 UTC
(In reply to Dominik Stadler from comment #1)
> Thanks for the patch, any chance of a unit-test that verifies these changes
> so they stay in place correctly in the future?

Hello,

actually I haven't created any, because I don't know what should I do exactly. Should I create one?