title: Pyspark cast StrucType[ArrayType, StructureType] to ArrayType[ArrayType,ArrayType]
body: <p>I have a DF with column 'COL_NAME' contain a StructType in format:</p>
  <pre><code>StructType[StructType, StructType, ArrayType, ArrayType, StructType, ArrayType, ArrayType]
  </code></pre>
  <p>The StructType above returned from UDF. I need to cast it to all ArrayType</p>
  <pre><code>ArrayType[ArrayType, ArrayType, ArrayType, ArrayType, ArrayType, ArrayType, ArrayType]
  </code></pre>
  <p>How to do it. Thank you so much</p>
  <h3>Updated</h3>
  <p>Example:</p>
  <pre><code>array need to return :
  [[before], [after], [from_tbl], [where_tbl], [to_tbl], [lst_tbl], [dbinfo]]
  
  where before/after is a list
  before, after = [[query_type,out,[from],[where]],[query_type,out,[from],[where]]]
  
  where querytype is string, out is string, but from, where is list, not same level
  
  to_tbl = [write_mode, [table_name], table_action]
  from_tbl, where_tbl, from, where, table_name, lst_tbl, db_info = [a,b,c]
  </code></pre>
  <p>when i define UDF, i have to define return schema, nested array not same level so i can not define valid schema for all</p>