Pyspark 如何在spark中正确读取DynamodbJSON数据(dynamodb从s3导出的数据),其中json文件可能具有不同大小的数据

Pyspark 如何在spark中正确读取DynamodbJSON数据(dynamodb从s3导出的数据),其中json文件可能具有不同大小的数据,pyspark,apache-spark-sql,Pyspark,Apache Spark Sql,我有dynamodbjson文件。其中有如下数据 text = sqlContext.read.text('dynamodb/*') text.take(2) json_df = sqlContext.read.json("dynamodb/*") json_df.printschema() 如您所见,数据可以有view1和/或view2。两者都是映射,可以有任意数量的值。View1和View2都有时间戳及其字节值。 现在,当将这些文件作为json读取时,printsc

我有dynamodbjson文件。其中有如下数据

text = sqlContext.read.text('dynamodb/*')
text.take(2)
json_df  = sqlContext.read.json("dynamodb/*")
json_df.printschema()
如您所见,数据可以有view1和/或view2。两者都是映射,可以有任意数量的值。View1和View2都有时间戳及其字节值。 现在,当将这些文件作为json读取时,printschema如下所示

text = sqlContext.read.text('dynamodb/*')
text.take(2)
json_df  = sqlContext.read.json("dynamodb/*")
json_df.printschema()
在读取json数据时如何避免这种情况