Code Monkey home page Code Monkey logo

Comments (19)

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

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.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

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.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

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.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

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.

alki123 avatar alki123 commented on June 3, 2024

File is also not corrupted.

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

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.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

alki123 avatar alki123 commented on June 3, 2024

Thanks jornfranke. Can I know what api you use to read excel file like apache poi or monitorjbl ?

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

from spark-hadoopoffice-ds.

jornfranke avatar jornfranke commented on June 3, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.