title: Create ArrayType column in Spark scala
body: <p>Structure of the Schema to be created:</p>
  
  <pre><code>|-- col1: boolean (nullable = true)
  |-- col2: array (nullable = true)
  |    |-- element: struct (containsNull = true)
  |    |    |-- col2_1: boolean (nullable = true)
  |    |    |-- col2_2: string (nullable = true)
  </code></pre>
  
  <p>Code to create schema:</p>
  
  <pre><code>val prodSchema = StructType(Array(StructField("col1", StringType), StructField("col2",ArrayType(Array(StructField("element",StructType(Array(StructField("col2_1",StringType)))))))))
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>found   : Array[org.apache.spark.sql.types.StructField]
  required: org.apache.spark.sql.types.DataType
  StructField("col2",ArrayType(Array(StructField("element",StructType(Array(StructField("col2_1",StringType)))))))
  </code></pre>
  
  <p>Any suggestions on how to correct this schema error.</p>