@Test
  public void testInt64ExactValue() {

    // basic value
    Timestamp ts1 = Timestamp.valueOf("2011-01-01 00:30:00.000000001");
    long millis = ParquetTimestampUtils.getInt64(ts1, LogicalTypeAnnotation.TimeUnit.MILLIS);
    Assert.assertEquals(1293841800_000L, millis);
    long micros = ParquetTimestampUtils.getInt64(ts1, LogicalTypeAnnotation.TimeUnit.MICROS);
    Assert.assertEquals(1293841800000_000L, micros);
    long nanos = ParquetTimestampUtils.getInt64(ts1, LogicalTypeAnnotation.TimeUnit.NANOS);
    Assert.assertEquals(1293841800000_000_001L, nanos);

    // test correct conversion to time units
    Timestamp ts2 = Timestamp.valueOf("2011-01-01 00:30:00.55555");
    millis = ParquetTimestampUtils.getInt64(ts2, LogicalTypeAnnotation.TimeUnit.MILLIS);
    Assert.assertEquals(1293841800_555L, millis);
    micros = ParquetTimestampUtils.getInt64(ts2, LogicalTypeAnnotation.TimeUnit.MICROS);
    Assert.assertEquals(1293841800_555_550L, micros);
    nanos = ParquetTimestampUtils.getInt64(ts2, LogicalTypeAnnotation.TimeUnit.NANOS);
    Assert.assertEquals(1293841800_555_550_000L, nanos);

    // test max nanos
    Timestamp ts3 = Timestamp.valueOf("2018-12-31 23:59:59.999999999");
    millis = ParquetTimestampUtils.getInt64(ts3, LogicalTypeAnnotation.TimeUnit.MILLIS);
    Assert.assertEquals(1546300799_999L, millis);
    micros = ParquetTimestampUtils.getInt64(ts3, LogicalTypeAnnotation.TimeUnit.MICROS);
    Assert.assertEquals(1546300799_999_999L, micros);
    nanos = ParquetTimestampUtils.getInt64(ts3, LogicalTypeAnnotation.TimeUnit.NANOS);
    Assert.assertEquals(1546300799_999_999_999L, nanos);

    // test pre-epoch date
    Timestamp ts4 = Timestamp.valueOf("1968-01-31 00:30:00.000000001");
    millis = ParquetTimestampUtils.getInt64(ts4, LogicalTypeAnnotation.TimeUnit.MILLIS);
    Assert.assertEquals(-60564600_000L, millis);
    micros = ParquetTimestampUtils.getInt64(ts4, LogicalTypeAnnotation.TimeUnit.MICROS);
    Assert.assertEquals(-60564600000_000L, micros);
    nanos = ParquetTimestampUtils.getInt64(ts4, LogicalTypeAnnotation.TimeUnit.NANOS);
    Assert.assertEquals(-60564599999_999_999L, nanos);
  }
17:00 PDT = 00:00 GMT (daylight-savings)
(0*60*60 + 1*60 + 1)*10e9 + 1 = 61000000001, or

17:00 PST = 01:00 GMT (if not daylight savings)
(1*60*60 + 1*60 + 1)*10e9 + 1 = 3661000000001
ql/src/test/org/apache/hadoop/hive/ql/io/parquet/serde/TestParquetTimestampUtils.java