private static byte[] createAvroRecordWithNestedTimestamp() throws IOException {
    File schemaFile = Paths.get(System.getProperty("test.data.dir"), "nested_ts.avsc").toFile();
    Schema schema = new Schema.Parser().parse(schemaFile);
    GenericData.Record rootRecord = new GenericData.Record(schema);
    rootRecord.put("id", "X338092");
    GenericData.Record dateRecord = new GenericData.Record(schema.getField("dischargedate").schema());
    final LocalDateTime _2022_07_05 = LocalDate.of(2022, 7, 5).atStartOfDay();
    // Store in UTC as required per Avro specification and as done by Hive in other parts of the system
    dateRecord.put("value", _2022_07_05.atZone(ZoneId.systemDefault()).toInstant().toEpochMilli());
    rootRecord.put("dischargedate", dateRecord);

    try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
      try (DataFileWriter<GenericRecord> dataFileWriter
             = new DataFileWriter<GenericRecord>(new GenericDatumWriter<>(schema))) {
        dataFileWriter.create(schema, out);
        dataFileWriter.append(rootRecord);
      }
      return out.toByteArray();
    }
  }
HBaseTestSetup defines HBase-specific test fixtures which are
reused across testcases.
itests/util/src/main/java/org/apache/hadoop/hive/hbase/HBaseTestSetup.java