title: Spark Dataset - NumberFormatException: Zero length BigInteger
body: <p>I'm facing a weird exception when I try to create a Dataset and simply collecting data from it.</p>
  
  <pre><code>Exception in thread "main" java.lang.NumberFormatException: Zero length BigInteger
      at java.math.BigInteger.&lt;init&gt;(BigInteger.java:302)
      at org.apache.spark.sql.catalyst.expressions.UnsafeRow.getDecimal(UnsafeRow.java:405)
      at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.writeFields_3_3$(generated.java:298)
      at org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificUnsafeProjection.apply(generated.java:35)
      at org.apache.spark.sql.execution.LocalTableScanExec$$anonfun$unsafeRows$1.apply(LocalTableScanExec.scala:41)
      at org.apache.spark.sql.execution.LocalTableScanExec$$anonfun$unsafeRows$1.apply(LocalTableScanExec.scala:41)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:234)
      at scala.collection.mutable.ResizableArray$class.foreach(ResizableArray.scala:59)
      at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:48)
      at scala.collection.TraversableLike$class.map(TraversableLike.scala:234)
      at scala.collection.AbstractTraversable.map(Traversable.scala:104)
      at org.apache.spark.sql.execution.LocalTableScanExec.unsafeRows$lzycompute(LocalTableScanExec.scala:41)
      at org.apache.spark.sql.execution.LocalTableScanExec.unsafeRows(LocalTableScanExec.scala:36)
      at org.apache.spark.sql.execution.LocalTableScanExec.executeCollect(LocalTableScanExec.scala:67)
      at org.apache.spark.sql.Dataset.org$apache$spark$sql$Dataset$$collectFromPlan(Dataset.scala:3278)
      at org.apache.spark.sql.Dataset$$anonfun$collectAsList$1.apply(Dataset.scala:2739)
      at org.apache.spark.sql.Dataset$$anonfun$collectAsList$1.apply(Dataset.scala:2738)
      at org.apache.spark.sql.Dataset$$anonfun$52.apply(Dataset.scala:3259)
      at org.apache.spark.sql.execution.SQLExecution$.withNewExecutionId(SQLExecution.scala:77)
      at org.apache.spark.sql.Dataset.withAction(Dataset.scala:3258)
      at org.apache.spark.sql.Dataset.collectAsList(Dataset.scala:2738)
      at com.temp.SparkTest.execute(SparkTest.java:85)
      at com.temp.SparkTest.main(SparkTest.java:104)
  </code></pre>
  
  <p>The executing code looks like this:</p>
  
  <pre><code>List&lt;SimplePojo&gt; list ...
  Dataset&lt;SimplePojo&gt; ds = sparkSession.createDataset(list, Encoders.bean(SimplePojo.class))
  ds.collectoAsList();
  </code></pre>
  
  <p>SimplePojo class contains one method <strong>getSomething()</strong> that apparently causes the exception. When I comment it out, everything works fine.</p>
  
  <pre><code>public class SimplePojo {
  
     private int id;
     private OtherPojo otherPojo = new OtherPojo();
  
     @Deprecated // required by park serialization. Use builder
     public SimplePojo(){}
  
     publi int getId(){
        return id;
     }
  
     public String getSomething() {
        return otherPojo.getSomething();
     }
  
     // sets ...
  }
  </code></pre>
  
  <p>Does anyone have any idea what might be happening?</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>CAUSE:
  Code above does not have attribute <strong>something</strong>. That causes the exception when the bean analyser (Introspector or something like this) find a <em>get</em> without a respective attribute (e.g: <strong>getSomething</strong> without attribute <strong>something</strong>). Creating an attribute and its set solved the exception but it did not resolve my problem. In my real code the "alone get" is getting a value from a composite attribute (OtherPojo).</p>
  
  <p>Any idea on how to "say" to the analyser to ignore this method? (I tried @Transiente above the method but it did not work) </p>