Class AvroTestUtils

java.lang.Object
com.pervasive.datarush.operators.testutils.AvroTestUtils

public class AvroTestUtils extends Object
  • Field Details

  • Constructor Details

    • AvroTestUtils

      public AvroTestUtils()
  • Method Details

    • 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)
    • avroString

      public static Object avroString(String value)
    • avroEnum

      public static Object avroEnum(org.apache.avro.Schema schema, String 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)