Class AvroTestUtils


  • public class AvroTestUtils
    extends Object
    • Constructor Detail

      • AvroTestUtils

        public AvroTestUtils()
    • Method Detail

      • makeNullable

        public static org.apache.avro.Schema makeNullable​(org.apache.avro.Schema schema)
      • writeAvroData

        public static void writeAvroData​(String path,
                                         RecordTokenList data,
                                         org.apache.avro.Schema targetSchema)
      • writeAvroFile

        public static <T> void writeAvroFile​(String outputPath,
                                             List<T> data,
                                             org.apache.avro.Schema targetSchema)
                                      throws IOException
        Throws:
        IOException
      • 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)