Skip to content

Commit

Permalink
Style Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pgaref committed Dec 29, 2020
1 parent 1cc8c0b commit 4475557
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions java/core/src/test/org/apache/orc/impl/TestRecordReaderImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -602,13 +602,13 @@ static TruthValue evaluateTimestampWithWriterCalendar(OrcProto.ColumnStatistics
boolean writerUsedProlepticGregorian,
boolean useUTCTimestamp) {
OrcProto.ColumnEncoding encoding =
OrcProto.ColumnEncoding.newBuilder()
.setKind(OrcProto.ColumnEncoding.Kind.DIRECT)
.build();
OrcProto.ColumnEncoding.newBuilder()
.setKind(OrcProto.ColumnEncoding.Kind.DIRECT)
.build();
return RecordReaderImpl.evaluatePredicateProto(stats, predicate, null,
encoding, null,
include135 ? OrcFile.WriterVersion.ORC_135: OrcFile.WriterVersion.ORC_101,
TypeDescription.createTimestamp(), writerUsedProlepticGregorian, useUTCTimestamp);
encoding, null,
include135 ? OrcFile.WriterVersion.ORC_135: OrcFile.WriterVersion.ORC_101,
TypeDescription.createTimestamp(), writerUsedProlepticGregorian, useUTCTimestamp);
}

static TruthValue evaluateTimestampBloomfilter(OrcProto.ColumnStatistics stats,
Expand Down Expand Up @@ -913,35 +913,36 @@ public void testPredEvalWithDecimalStats() throws Exception {
@Test
public void testPredEvalTimestampStatsDiffWriter() {
// Proleptic - NoUTC
PredicateLeaf pred = createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
PredicateLeaf.Type.TIMESTAMP, "x", Timestamp.valueOf("1017-01-01 00:00:00"), null);
PredicateLeaf pred = createPredicateLeaf(
PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.TIMESTAMP, "x",
Timestamp.valueOf("1017-01-01 00:00:00"), null);
assertEquals(TruthValue.YES_NO,
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred, true, true, false));
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred, true, true, false));

// NoProleptic - NoUTC -> 1016-12-26 00:00:00.0
long predTime = DateUtils.convertTimeToProleptic(Timestamp.valueOf("1017-01-01 00:00:00").getTime(), false);
PredicateLeaf pred2 = createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
PredicateLeaf pred2 = createPredicateLeaf(
PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
assertEquals(TruthValue.YES_NO,
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred2, true, false, false));
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred2, true, false, false));

// NoProleptic - UTC -> 1016-12-25 16:00:00.0
predTime = DateUtils.convertTimeToProleptic(getUtcTimestamp("1017-01-01 00:00:00"), true);
PredicateLeaf pred3 = createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
PredicateLeaf pred3 = createPredicateLeaf(
PredicateLeaf.Operator.NULL_SAFE_EQUALS, PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
assertEquals(TruthValue.YES_NO,
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred3, true, false, true));
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred3, true, false, true));

// Proleptic - UTC -> 1016-12-31 16:00:00.0
predTime = getUtcTimestamp("1017-01-01 00:00:00");
PredicateLeaf pred4 = createPredicateLeaf(PredicateLeaf.Operator.NULL_SAFE_EQUALS,
PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
PredicateLeaf.Type.TIMESTAMP, "x", new Timestamp(predTime), null);
assertEquals(TruthValue.YES_NO,
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred4, true, true, true));
evaluateTimestampWithWriterCalendar(createTimestampStats("1017-01-01 00:00:00", "1017-01-01 00:00:00"),
pred4, true, true, true));
}

@Test
Expand Down

0 comments on commit 4475557

Please sign in to comment.