- java.lang.Object
-
- com.pervasive.datarush.operators.testutils.AvroTestUtils
-
public class AvroTestUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static RecordTokenTypeALL_TYPES
-
Constructor Summary
Constructors Constructor Description AvroTestUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectavroBytes(byte[] value)static ObjectavroDate(int year, int monthOfYear, int dayOfMonth)static ObjectavroEnum(org.apache.avro.Schema schema, String value)static 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 Detail
-
ALL_TYPES
public static final RecordTokenType ALL_TYPES
-
-
Method Detail
-
makeNullable
public static org.apache.avro.Schema makeNullable(org.apache.avro.Schema schema)
-
readAvroData
public static RecordTokenList readAvroData(String path, String... fields)
-
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
public static RecordTokenList constructData(List<? extends ScalarToken> values)
-
constructData
public static List<org.apache.avro.generic.GenericRecord> constructData(org.apache.avro.Schema schema, String field, List<?> values)
-
avroBytes
public static Object avroBytes(byte[] value)
-
avroFixed
public static Object avroFixed(org.apache.avro.Schema schema, byte[] value)
-
avroDate
public static Object avroDate(int year, int monthOfYear, int dayOfMonth)
-
avroTime
public static Object avroTime(int hourOfDay, int minuteOfHour, int secondOfMinute)
-
avroTimestamp
public static Object avroTimestamp(long secs, int nanos, int offset)
-
-