Search in sources :

Example 1 with MercifulJsonConverter

use of org.apache.hudi.avro.MercifulJsonConverter in project hudi by apache.

the class SchemaTestUtil method generateAvroRecordFromJson.

public static GenericRecord generateAvroRecordFromJson(Schema schema, int recordNumber, String instantTime, String fileId, boolean populateMetaFields) throws IOException {
    SampleTestRecord record = new SampleTestRecord(instantTime, recordNumber, fileId, populateMetaFields);
    MercifulJsonConverter converter = new MercifulJsonConverter();
    return converter.convert(record.toJsonString(), schema);
}
Also used : MercifulJsonConverter(org.apache.hudi.avro.MercifulJsonConverter)

Aggregations

MercifulJsonConverter (org.apache.hudi.avro.MercifulJsonConverter)1