Skip to content

Commit

Permalink
EPS
Browse files Browse the repository at this point in the history
  • Loading branch information
kgyrtkirk committed Nov 13, 2023
1 parent 27a367d commit 90283b3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1113,17 +1113,19 @@ void validate(int row, int column, ValueType type, Object expectedCell, Object r
void validate(int row, int column, ValueType type, Object expectedCell, Object resultCell)
{
if (expectedCell instanceof Float) {
float eps = 1000*Math.ulp((Float) expectedCell);
assertEquals(
mismatchMessage(row, column),
(Float) expectedCell,
(Float) resultCell,
ASSERTION_EPSILON);
eps);
} else if (expectedCell instanceof Double) {
double eps = 1000*Math.ulp((Double) expectedCell);
assertEquals(
mismatchMessage(row, column),
(Double) expectedCell,
(Double) resultCell,
ASSERTION_EPSILON);
eps);
} else {
EQUALS.validate(row, column, type, expectedCell, resultCell);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,13 +371,13 @@ public void verify(String sql, QueryResults queryResults)
results.sort(new ArrayRowCmp());
expectedResults.sort(new ArrayRowCmp());
}
assertResultsEquals(sql, expectedResults, results);
assertResultsValid(ResultMatchMode.EQUALS_EPS, expectedResults, queryResults);
}
catch (AssertionError e) {
log.info("query: %s", sql);
log.info(resultsToString("Expected", expectedResults));
log.info(resultsToString("Actual", results));
throw e;
throw new AssertionError(sql, e);
}
}

Expand Down Expand Up @@ -6535,7 +6535,6 @@ public void test_aggregates_woPrtnBy_3()
windowQueryTest();
}

@NotYetSupported(Modes.RESULT_MISMATCH)
@DrillTest("aggregates/woPrtnBy_4")
@Test
public void test_aggregates_woPrtnBy_4()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ enum Modes
INCORRECT_SYNTAX(DruidException.class, "Incorrect syntax near the keyword"),
// at least c7 is represented oddly in the parquet file
T_ALLTYPES_ISSUES(AssertionError.class, "(t_alltype|allTypsUniq|fewRowsAllData).parquet.*Verifier.verify"),
RESULT_MISMATCH(AssertionError.class, "assertResultsEquals"),
RESULT_MISMATCH(AssertionError.class, "(assertResultsEquals|AssertionError: column content mismatch)"),
UNSUPPORTED_NULL_ORDERING(DruidException.class, "(A|DE)SCENDING ordering with NULLS (LAST|FIRST)"),
CANNOT_TRANSLATE(DruidException.class, "Cannot translate reference");

Expand Down

0 comments on commit 90283b3

Please sign in to comment.