[HUDI-345] Fix used deprecated function (#1024)
- Schema.parse() with new Schema.Parser().parse - FSDataOutputStream constructor
This commit is contained in:
@@ -48,12 +48,12 @@ object AvroConversionUtils {
|
||||
ss.createDataFrame(rdd.mapPartitions { records =>
|
||||
if (records.isEmpty) Iterator.empty
|
||||
else {
|
||||
val schema = Schema.parse(schemaStr)
|
||||
val schema = new Schema.Parser().parse(schemaStr)
|
||||
val dataType = convertAvroSchemaToStructType(schema)
|
||||
val convertor = AvroConversionHelper.createConverterToRow(schema, dataType)
|
||||
records.map { x => convertor(x).asInstanceOf[Row] }
|
||||
}
|
||||
}, convertAvroSchemaToStructType(Schema.parse(schemaStr))).asInstanceOf[Dataset[Row]]
|
||||
}, convertAvroSchemaToStructType(new Schema.Parser().parse(schemaStr))).asInstanceOf[Dataset[Row]]
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user