I cannot create a DataFrame because of coordinates
. This field does not fit the schema type ArrayType(DoubleType())
.
my_schema = StructType(
[
StructField('alarm_id', StringType()),
StructField('coordinates',ArrayType(DoubleType()))
])
df = spark.createDataFrame(rows, my_schema)
I get this error:
TypeError: ArrayType(DoubleType,true) can not accept object u'[[[1.7594273000000102, 41.82814869999999], [1.7594281999999908, 41.828104700000004]]]' in type <type 'unicode'>
Is there any workaround?
rows
look like? – Woody1193