[SPARK-4133] [SQL] [PySpark] type conversionfor python udf

Call Python UDF on ArrayType/MapType/PrimitiveType, the returnType can also be ArrayType/MapType/PrimitiveType.

For StructType, it will act as tuple (without attributes). If returnType is StructType, it also should be tuple.
Nit/existing: I'd avoid creating attributes which is actually pretty expensive due to an `AtomicLong` and use the public API for `schema`.  I think instead of these two lines you can just do the following here and above.

```scala
val fieldTypes = schema.fields.map(_.dataType)
```