java.lang.Object
com.pervasive.datarush.operators.testutils.AvroTestUtils
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectavroBytes(byte[] value) static ObjectavroDate(int year, int monthOfYear, int dayOfMonth) static Objectstatic ObjectavroFixed(org.apache.avro.Schema schema, byte[] value) static ObjectavroString(String value) static ObjectavroTime(int hourOfDay, int minuteOfHour, int secondOfMinute) static ObjectavroTimestamp(long secs, int nanos, int offset) static RecordTokenListconstructData(List<? extends ScalarToken> values) static List<org.apache.avro.generic.GenericRecord>constructData(org.apache.avro.Schema schema, String field, List<?> values) static org.apache.avro.SchemamakeNullable(org.apache.avro.Schema schema) static RecordTokenListreadAvroData(String path, String... fields) static List<org.apache.avro.generic.GenericRecord>readAvroFile(String path) static voidwriteAvroData(String path, RecordTokenList data, org.apache.avro.Schema targetSchema) static voidwriteAvroData(String path, RecordTokenList data, org.apache.avro.Schema targetSchema, WriteMode mode) static <T> voidwriteAvroFile(String outputPath, List<T> data, org.apache.avro.Schema targetSchema)
-
Field Details
-
ALL_TYPES
-
-
Constructor Details
-
AvroTestUtils
public AvroTestUtils()
-
-
Method Details
-
makeNullable
public static org.apache.avro.Schema makeNullable(org.apache.avro.Schema schema) -
readAvroData
-
writeAvroData
public static void writeAvroData(String path, RecordTokenList data, org.apache.avro.Schema targetSchema) -
writeAvroData
public static void writeAvroData(String path, RecordTokenList data, org.apache.avro.Schema targetSchema, WriteMode mode) -
readAvroFile
public static List<org.apache.avro.generic.GenericRecord> readAvroFile(String path) throws IOException - Throws:
IOException
-
writeAvroFile
public static <T> void writeAvroFile(String outputPath, List<T> data, org.apache.avro.Schema targetSchema) throws IOException - Throws:
IOException
-
constructData
-
constructData
-
avroBytes
-
avroFixed
-
avroString
-
avroEnum
-
avroDate
-
avroTime
-
avroTimestamp
-