I am trying to create spark SQL table by creating RDD in Scala program with column count of 200+. The compilation (sbt compile) fails with java.lang.StackOverflowError exception when i create my schema as:
StructField("RT", StringType,nullable = true) ::
StructField("SERIALNO", StringType,nullable = true) ::
StructField("SPORDER", StringType,nullable = true) ::
// ... remaining 200+ columns
Can't paste the stacktrace as it is more than 1.5k lines
On reducing the column count to around 100-120 compilation succeeds. Also, when i create a schema using schema string (splitting schema string and then creating map of it), compilation succeeds (First example under heading "Programmatically Specifying the Schema" in https://spark.apache.org/docs/1.3.0/sql-programming-guide.html).
What seems to be problem with manually specifying schema which results in exception?
tailrec. I'd post an issue on the Spark JIRA. - Reactormonk