title: IndexOutOfBounds Error in Zeppelin
body: <p>I have an issue in Zeppelin that when i try to perform an SQL operation on a temptable (of dataframe) that i've created i always get an IndexOutOfBounds error.</p>
  
  <p>Here's my code:</p>
  
  <pre><code>import org.apache.commons.io.IOUtils
  import java.net.URL
  import java.nio.charset.Charset
  import org.apache.spark.sql.SparkSession
  //import sqlContext._
  
  val realdata = sc.textFile("/root/application.txt")
  
  case class testClass(date: String, time: String, level: String, unknown1: String, unknownConsumer: String, unknownConsumer2: String, vloer: String, tegel: String, msg: String, sensor1: String, sensor2: String, sensor3: String, sensor4: String, sensor5: String, sensor6: String, sensor7: String, sensor8: String, batchsize: String, troepje1: String, troepje2: String)
  
  val mapData = realdata
  .filter(line =&gt; line.contains("data") &amp;&amp; line.contains("INFO"))
  .map(s =&gt; s.split(" ").toList)
  .map(
  s =&gt; testClass(s(0),
  s(1).split(",")(0),
  s(1).split(",")(1),
  s(3),
  s(4),
  s(5),
  s(6),
  s(7),
  s(8),
  s(15),
  s(16),
  s(17),
  s(18),
  s(19),
  s(20),
  s(21),
  s(22),
  "",
  "",
  ""
  )
  ).toDF
  //mapData.count()
  //mapData.printSchema()
  mapData.registerTempTable("temp_carefloor")
  </code></pre>
  
  <p>And then in the next notebook i try something simple like:</p>
  
  <pre><code>%sql
  select * from temp_carefloor limit 10
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>java.lang.IndexOutOfBoundsException: 18
      at scala.collection.LinearSeqOptimized$class.apply(LinearSeqOptimized.scala:65)
      at scala.collection.immutable.List.apply(List.scala:84)
      at $line128330188484.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$3.apply(&lt;console&gt;:84)
      at $line128330188484.$read$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$iw$$anonfun$3.apply(&lt;console&gt;:72)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      at scala.collection.Iterator$$anon$11.next(Iterator.scala:409)
      at org.apache.spark.sql.execution.SparkPlan$$anonfun$2.apply(SparkPlan.scala:232)
      at org.apache.spark.sql.execution.SparkPlan$$anonfun$2.apply(SparkPlan.scala:225)
      at org.apache.spark.rdd.RDD$$anonfun$mapPartitionsInternal$1$$anonfun$apply$25.apply(RDD.scala:826)
      at org.apache.spark.rdd.RDD$$anonfun$mapPartitionsInternal$1$$anonfun$apply$25.apply(RDD.scala:826)
      at org.apache.spark.rdd.MapPartitionsRDD.compute(MapPartitionsRDD.scala:38)
      at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:323)
      at org.apache.spark.rdd.RDD.iterator(RDD.scala:287)
      at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:87)
      at org.apache.spark.scheduler.Task.run(Task.scala:99)
      at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:282)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:748)
  </code></pre>
  
  <p>Now i'm sure it has something to do with the way my data is outputted.
  But i just can't figure out what i'm doing wrong and i'm really hitting my head here. Really hoping somebody can help me out.</p>
  
  <p>EDIT:
  Here's an excerpt of usefull data i'm trying to extract.</p>
  
  <pre><code>2016-03-10 07:18:58,985 INFO [http-nio-8080-exec-1] n.t.f.c.FloorUpdateController [FloorUpdateController.java:67] Floor 12FR received update from tile: 12G0, data = [false, false, false, false, true, false, false, false]
  2016-03-10 07:18:58,992 INFO [http-nio-8080-exec-7] n.t.f.c.FloorUpdateController [FloorUpdateController.java:67] Floor 12FR received update from tile: 12G0, data = [false, false, false, false, false, false, false, false]
  2016-03-10 07:18:59,907 INFO [http-nio-8080-exec-4] n.t.f.c.FloorUpdateController [FloorUpdateController.java:67] Floor 12FR received update from tile: 12G0, data = [false, false, false, false, false, false, false, false]
  2016-03-10 07:19:10,418 INFO [http-nio-8080-exec-9] n.t.f.c.FloorUpdateController [FloorUpdateController.java:67] Floor 12FR received update from tile: 12G0, data = [true, true, false, false, false, false, false, false]
  </code></pre>
  
  <p>You can see the full flat file here: <a href="http://upload.grecom.nl/uploads/jeffrey/application.txt" rel="nofollow noreferrer">http://upload.grecom.nl/uploads/jeffrey/application.txt</a></p>