// This test is migrated from OrcHadoopInputRowParserTest
@Test
  public void testDate2038() throws IOException
  {
    final InputEntityReader reader = createReader(
        new TimestampSpec("time", "millis", null),
        new DimensionsSpec(null, Collections.singletonList("time"), null),
        new OrcInputFormat(new JSONPathSpec(true, null), null, new Configuration()),
        "example/TestOrcFile.testDate2038.orc"
    );
    try (CloseableIterator<InputRow> iterator = reader.read()) {
      int actualRowCount = 0;
      Assert.assertTrue(iterator.hasNext());
      final InputRow row = iterator.next();
      actualRowCount++;
      Assert.assertEquals(1, row.getDimensions().size());
      Assert.assertEquals(DateTimes.of("2038-05-05T12:34:56.1Z"), row.getTimestamp());
      Assert.assertEquals("2038-12-25T00:00:00.000Z", Iterables.getOnlyElement(row.getDimension("date")));
      while (iterator.hasNext()) {
        actualRowCount++;
        iterator.next();
      }
      Assert.assertEquals(212000, actualRowCount);
    }
  }
@Test
public void testDate2038() throws IOException
{
final InputEntityReader reader = createReader(
new TimestampSpec("time", "millis", null),
new DimensionsSpec(null, Collections.singletonList("time"), null),
new OrcInputFormat(new JSONPathSpec(true, null), null, new Configuration()),
"example/TestOrcFile.testDate2038.orc"
);
try (CloseableIterator<InputRow> iterator = reader.read()) {
int actualRowCount = 0;
Assert.assertTrue(iterator.hasNext());
final InputRow row = iterator.next();
actualRowCount++;
Assert.assertEquals(1, row.getDimensions().size());
Assert.assertEquals(DateTimes.of("2038-05-05T12:34:56.1Z"), row.getTimestamp());
Assert.assertEquals("2038-12-25T00:00:00.000Z", Iterables.getOnlyElement(row.getDimension("date")));
while (iterator.hasNext()) {
actualRowCount++;
iterator.next();
}
Assert.assertEquals(212000, actualRowCount);
}
}
@Test
public void testDate2038() throws IOException
{
final InputEntityReader reader = createReader(
new TimestampSpec("time", "millis", null),
new DimensionsSpec(null, Collections.singletonList("time"), null),
new OrcInputFormat(new JSONPathSpec(true, null), null, new Configuration()),
"example/TestOrcFile.testDate2038.orc"
);
try (CloseableIterator<InputRow> iterator = reader.read()) {
int actualRowCount = 0;
Assert.assertTrue(iterator.hasNext());
final InputRow row = iterator.next();
actualRowCount++;
Assert.assertEquals(1, row.getDimensions().size());
Assert.assertEquals(DateTimes.of("2038-05-05T12:34:56.1Z"), row.getTimestamp());
Assert.assertEquals("2038-12-25T00:00:00.000Z", Iterables.getOnlyElement(row.getDimension("date")));
while (iterator.hasNext()) {
actualRowCount++;
iterator.next();
}
Assert.assertEquals(212000, actualRowCount);
}
}
@Test
public void testDate2038() throws IOException
{
final InputEntityReader reader = createReader(
new TimestampSpec("time", "millis", null),
new DimensionsSpec(null, Collections.singletonList("time"), null),
new OrcInputFormat(new JSONPathSpec(true, null), null, new Configuration()),
"example/TestOrcFile.testDate2038.orc"
);
try (CloseableIterator<InputRow> iterator = reader.read()) {
int actualRowCount = 0;
Assert.assertTrue(iterator.hasNext());
final InputRow row = iterator.next();
actualRowCount++;
Assert.assertEquals(1, row.getDimensions().size());
Assert.assertEquals(DateTimes.of("2038-05-05T12:34:56.1Z"), row.getTimestamp());
Assert.assertEquals("2038-12-25T00:00:00.000Z", Iterables.getOnlyElement(row.getDimension("date")));
while (iterator.hasNext()) {
actualRowCount++;
iterator.next();
}
Assert.assertEquals(212000, actualRowCount);
}
}