Reading/Writing Excel documents with the HadoopOffice library on Hadoop and Spark – First release

Reading/Writing office documents, such as Excel, has been always challenging on Big data platforms. Although many libraries exist for reading/writing office documents, they have never been really integrated in Hadoop or Spark and thus lead to a lot of development efforts.

There are several use cases for using office documents jointly with Big data technologies:

  • Enabling the full customer-centric data science lifecycle: Within your Big Data platform you crunch numbers for complex models. However, you have to make them accessible to your customers. Le us assume you work in the insurance industry. Your Big Data platform calculates various models focused on your customer for insurance products. Your sales staff receives the models in Excel format. They can now play together with the customers on the different parameters, e.g. retirement age, individual risks etc. They may also come up with a different proposal more suitable for your customer and you want to feed it back into your Big Data platform to see if it is feasible.
  • You still have a lot of data in Excel files related to your computation. Let it be code lists, data collected manually or your existing systems simply support this format.

Hence, the HadoopOffice library was created and the first version has just been released!

It features:

Of course, further releases are planned:

  • Support for signing and verification of signature of Excel documents
  • Going beyond Excel with further office formats, such as ODF Calc
  • A Hive Serde for querying and writing Excel documents directly in Hive
  • Further examples including one for Apache Flink

2 Kommentare

  1. Hi ,
    I have implemented this feature in java programm :


    java code

    String file = „/home/empower/WorkingData/Project/Spark Work/spark_file_dir/input/file“;
    String source = „“;
    String key = „read.locale.bcp47“;
    String value = „de“;
    Dataset rowds = sparkSession.sqlContext().read().format(source).option(key,value).load(file);

    error : 17/03/07 12:55:13 ERROR Executor: Exception in task 0.0 in stage 0.0 (TID 0)
    java.lang.NoSuchMethodError: scala.runtime.IntRef.create(I)Lscala/runtime/IntRef;




    at scala.collection.Iterator

        \[anon$ 	at scala.collection.Iterator\]

    anon 	at org.apache.spark.sql.execution.datasources.FileScanRDD<span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="" height="67" width="1846" class="ql-img-displayed-equation quicklatex-auto-format" alt="\[anon$ 	at org.apache.spark.sql.catalyst.expressions.GeneratedClass$GeneratedIterator.processNext(Unknown Source) 	at org.apache.spark.sql.execution.BufferedRowIterator.hasNext( 	at org.apache.spark.sql.execution.WholeStageCodegenExec\]" title="Rendered by"/>anonfun


        \[anon$1.hasNext(WholeStageCodegenExec.scala:370) 	at org.apache.spark.sql.execution.SparkPlan\]


        4.apply(SparkPlan.scala:246) 	at org.apache.spark.sql.execution.SparkPlan<span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="" height="49" width="459" class="ql-img-displayed-equation quicklatex-auto-format" alt="\[anonfun$4.apply(SparkPlan.scala:240) 	at org.apache.spark.rdd.RDD\]" title="Rendered by"/>anonfun


        1<span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="" height="49" width="484" class="ql-img-displayed-equation quicklatex-auto-format" alt="\[anonfun$apply$24.apply(RDD.scala:784) 	at org.apache.spark.rdd.RDD\]" title="Rendered by"/>anonfun

    mapPartitionsInternal1anonfunapply24.apply(RDD.scala:784) 	at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38) 	at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:319) 	at org.apache.spark.rdd.RDD.iterator(RDD.scala:283) 	at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70) 	at 	at
    at java.util.concurrent.ThreadPoolExecutor.runWorker(
    at java.util.concurrent.ThreadPoolExecutor$

    A little help is much appreciate thanks

    Spark Version : 2.0.0
    java 1.8


    1. Hi, This error does not seem to be related to HadoopOffice, but to your application. You seem to compile for Scala 2.11, but your cluster (or in one of your dependencies) you use Scala 2.10. The examples in the hadoopoffice library do contain a build.sbt for proper compiling for scala 2.10 and scala 2.11 (both versions are supported). Find here some more information: Please let me know if it helped you. If not then do not hesitate to create an issue on Github. Thanks! All the best

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert