Comments (19)
from spark-hadoopoffice-ds.
I tried setting hadoopoffice.read.lowFootprint as true. I am only reading .xlsx file. Still the same error occurs. I am reading only a small excel file of 60 mb. Java maximum heap memory size is 1024 mb.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
dsAsRow = sparkSQL.read().option("read.spark.useHeader", useHeader)
.option("hadoopoffice.read.lowFootprint","true")
.option("read.spark.simpleMode", "true").option("read.locale.bcp47", "us")
.option("hadoopoffice.read.sheets", SheetName)
.option("hadoopoffice.read.mimeType",
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
.format("org.zuinnote.spark.office.excel")
This is my code for creating data frame.. Here header is true. There are totally around million rows and 12 columns. It contains both string and numeric data. I am reading from the container log in azure cluster
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
As you said I changed hadoopoffice.read.lowFootprint to read.lowFootprint. Now there is no error. But dataframe is not yet created. These are the last four lines of the log.
18/02/22 10:16:24 INFO OfficeReader: Using standard API to parse Excel file
18/02/22 10:16:25 INFO ContextCleaner: Cleaned accumulator 76
18/02/22 10:16:26 INFO ContextCleaner: Cleaned accumulator 75
18/02/22 10:16:26 INFO BlockManagerInfo: Removed broadcast_3_piece0 on 192.168.0.5:33457 in memory (size: 7.6 KB, free: 1458.6 MB)
18/02/22 10:16:26 INFO BlockManagerInfo: Removed broadcast_3_piece0 on 192.168.0.7:34979 in memory (size: 7.6 KB, free: 912.3 MB)
Logger info after creating dataframe is not printed in log.
Does it take more than 10 mins to create dataframe for a 60 mb file?
I had been using crealytics in the past. But there were some issues with it. Thats why trying out hadoop office.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
It works well for small files. The problem is only with big files. I have even changed the heap size to 2048mb. Still out of memory error occurs.
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.xerces.xni.XMLString.toString(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanAttribute(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
at org.apache.poi.util.DocumentHelper.readDocument(DocumentHelper.java:140)
at org.apache.poi.POIXMLTypeLoader.parse(POIXMLTypeLoader.java:143)
at org.openxmlformats.schemas.spreadsheetml.x2006.main.WorksheetDocument$Factory.parse(Unknown Source)
at org.apache.poi.xssf.usermodel.XSSFSheet.read(XSSFSheet.java:183)
at org.apache.poi.xssf.usermodel.XSSFSheet.onDocumentRead(XSSFSheet.java:175)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.parseSheet(XSSFWorkbook.java:438)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.onDocumentRead(XSSFWorkbook.java:403)
at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:190)
at org.apache.poi.xssf.usermodel.XSSFWorkbook.(XSSFWorkbook.java:266)
at org.apache.poi.ss.usermodel.WorkbookFactory.create(WorkbookFactory.java:185)
at org.zuinnote.hadoop.office.format.common.parser.MSExcelParser.parse(MSExcelParser.java:146)
at org.zuinnote.hadoop.office.format.common.OfficeReader.parse(OfficeReader.java:90)
at org.zuinnote.hadoop.office.format.mapreduce.AbstractSpreadSheetDocumentRecordReader.initialize(AbstractSpreadSheetDocumentRecordReader.java:130)
at org.zuinnote.spark.office.excel.HadoopFileExcelReader.(HadoopFileExcelReader.scala:56)
at org.zuinnote.spark.office.excel.DefaultSource.inferSchema(DefaultSource.scala:147)
at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$7.apply(DataSource.scala:177)
at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$7.apply(DataSource.scala:177)
at scala.Option.orElse(Option.scala:289)
at org.apache.spark.sql.execution.datasources.DataSource.getOrInferFileFormatSchema(DataSource.scala:176)
at org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:366)
at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:178)
from spark-hadoopoffice-ds.
File is also not corrupted.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
How much memory is exactly needed?
It does not work in low footprint also.
Yes I can open the excel file properly.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
Thanks jornfranke. Can I know what api you use to read excel file like apache poi or monitorjbl ?
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
from spark-hadoopoffice-ds.
I am closing this issue. I recommend trying with the newest HadoopOffice library and/or adding more memory.
from spark-hadoopoffice-ds.
Related Issues (20)
- java.lang.NoSuchMethodError while using spark-hadoopoffice-ds_2.11 (v1.2.4) HOT 7
- Doesn't generate excel file as expected but no obvious error HOT 3
- Cell with Integer value has an = sign HOT 24
- Spark Datasource does not pick up options for writing correctly HOT 2
- Job abortion on databricks HOT 2
- IndexOutOfBoundsException: When reading xlsx file. HOT 8
- How do i get a schema that's all String with "read.spark.simpleMode" HOT 2
- Add support for partitioning by folders in Hive/Spark Style HOT 19
- Writing to XLSX only outputs String fields but XLS works fine HOT 11
- workbookDocument .getWorkbook().getWorkbookPr() can return null HOT 8
- Support for Scala 2.13 and drop support for Scala 2.11 HOT 1
- Support Spark 3.1 HOT 8
- lowFootprint: numeric column values result in nulls HOT 7
- Nullpointer Exception when using Spark with Kyroserializer HOT 2
- "hadoopoffice.write.header.write" is only working for default sheet HOT 6
- Spill over to next sheet if number of rows exceeding Excel limitations
- Skipped imported decimal values HOT 11
- Not all HadoopOffice configuration is applied correctly
- CVE-2021-44228: Mitigate Log4shell HOT 2
- inferSchema for Excelfiles with one row is not working correctly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spark-hadoopoffice-ds.