2
我有一个RDD类型的行,即RDD [Row]和avro模式对象。我需要用这个信息创建一个数据框。如何将Avro Schema对象转换为spark中的StructType
我需要将avro模式对象转换为用于创建DataFrame的StructType。
您能否请帮助。
我有一个RDD类型的行,即RDD [Row]和avro模式对象。我需要用这个信息创建一个数据框。如何将Avro Schema对象转换为spark中的StructType
我需要将avro模式对象转换为用于创建DataFrame的StructType。
您能否请帮助。
com.databricks.spark.avro有一个类来帮助您完成此
StructType requiredType = (StructType) SchemaConverters.toSqlType(AvroClass.getClassSchema()).dataType();
请通过这个具体的例子:的http://bytepadding.com/big-data/spark/read-write-parquet-files-using-spark/
可能重复http://stackoverflow.com/questions/ 33899417/Avro的图式 - 火花,structtype –