Description
There are two main ways to construct `StructType`:
- Primary constructor
```scala
case class StructType(fields: Array[StructField])
```
- Use `Seq` as input constructor
```scala
def apply(fields: Seq[StructField]): StructType = StructType(fields.toArray)
```
These two construction methods are widely used in Spark, but the latter requires an additional collection conversion.
This pr changes the following 3 scenarios to use primary constructor to reduce one collection conversion:
1. For manually create `Seq` input scenes, change to use manually create `Array` input instead, for examaple:
2. For the scenario where 'toSeq' is added to create input for compatibility with Scala 2.13, directly call 'toArray' to instead, for example:
3. For scenes whose input is originally `Array`, remove the redundant `toSeq`, for example: