miachm/SODS

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office.

lbyzx123 opened this issue · 3 comments

Version :SODS-1.2.2-SNAPSHOT.jar.zip

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office.

When reading a file edited with Apache OpenOffice, there is a memory overflow.Stack info:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.github.miachm.sods.Cell.(Cell.java:6)
at com.github.miachm.sods.Sheet.checkLazyRowLoading(Sheet.java:306)
at com.github.miachm.sods.Sheet.setRowHeight(Sheet.java:502)
at com.github.miachm.sods.OdsReader.processTable(OdsReader.java:277)
at com.github.miachm.sods.OdsReader.processSpreadsheet(OdsReader.java:223)
at com.github.miachm.sods.OdsReader.iterateFilesEntries(OdsReader.java:216)
at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:77)
at com.github.miachm.sods.OdsReader.load(OdsReader.java:43)
at com.github.miachm.sods.OdsReader.load(OdsReader.java:35)
at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:52)
at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:39)
at com.center.test.ODSParserHelper.getDataFromSpreadsheet(ODSParserHelper.java:72)

My file download link is: https://github.com/lbyzx123/SODS/blob/master/alarm_config_rule_openoffice.ods

Version :SODS-1.2.2-SNAPSHOT.jar.zip

Sods-1.2.2-snapshot supports office very well, but it is not compatible with open office.

When reading a file edited with Apache OpenOffice, there is a memory overflow.Stack info:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at com.github.miachm.sods.Cell.(Cell.java:6)
at com.github.miachm.sods.Sheet.checkLazyRowLoading(Sheet.java:306)
at com.github.miachm.sods.Sheet.setRowHeight(Sheet.java:502)
at com.github.miachm.sods.OdsReader.processTable(OdsReader.java:277)
at com.github.miachm.sods.OdsReader.processSpreadsheet(OdsReader.java:223)
at com.github.miachm.sods.OdsReader.iterateFilesEntries(OdsReader.java:216)
at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:77)
at com.github.miachm.sods.OdsReader.load(OdsReader.java:43)
at com.github.miachm.sods.OdsReader.load(OdsReader.java:35)
at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:52)
at com.github.miachm.sods.SpreadSheet.(SpreadSheet.java:39)
at com.center.test.ODSParserHelper.getDataFromSpreadsheet(ODSParserHelper.java:72)

My file download link is: https://github.com/lbyzx123/SODS/blob/master/alarm_config_rule_openoffice.ods

Can you help me. Thanks!

That's not a regular file of Open Office. It was generated by Excel and then edited by OpenOffice. It looks like Open Office tried to preserve the info from Excel's.

The pattern is weird. It tries to reserves 100.000 rows and then it tries to set the row 100.001th. That destroys the system of lazy loading.

I suppose that there is no way to workaround this problem. There is always a "but".

So the solution must be the new sheet's architecture:
2f6aeb1

Thanks