ArrayType需要元素的类型。尝试:
schema = StructType([StructField('id', StringType()), \
StructField('timestamp',LongType()), \
StructField('coordinates',ArrayType(DoubleType()))])
rows = [Row(id="11", timestamp=1523975430000, coordinates = [ 41.5555, 2.1522])]
结果:
+---+-------------+-----------------+
| id| timestamp| coordinates|
+---+-------------+-----------------+
| 11|1523975430000|[41.5555, 2.1522]|
+---+-------------+-----------------+