kgyrtkirk commented on code in PR #15086:
URL: https://github.com/apache/druid/pull/15086#discussion_r1354115970
##########
sql/src/test/java/org/apache/druid/sql/calcite/BaseCalciteQueryTest.java:
##########
@@ -1055,6 +1064,115 @@ public Map<String, Object> baseQueryContext()
}
}
+ public enum ResultMatchMode
+ {
+ EQUALS {
+ @Override
+ void validate(int row, int column, ValueType type, Object expectedCell,
Object resultCell)
+ {
+ assertEquals(
+ mismatchMessage(row, column),
+ expectedCell,
+ resultCell);
+ }
+ },
+ RELAX_NULLS {
+ @Override
+ void validate(int row, int column, ValueType type, Object expectedCell,
Object resultCell)
+ {
+ if (expectedCell == null) {
+ if (resultCell == null) {
+ return;
+ }
+ expectedCell = NullHandling.defaultValueForType(type);
+ }
+ EQUALS.validate(row, column, type, expectedCell, resultCell);
+ }
+ },
+ EQUALS_EPS {
+ @Override
+ void validate(int row, int column, ValueType type, Object expectedCell,
Object resultCell)
+ {
+ if (expectedCell instanceof Float) {
+ assertEquals(
+ mismatchMessage(row, column),
+ (Float) expectedCell,
+ (Float) resultCell,
+ 1e-5);
Review Comment:
two tests were overriding the `assertResultsEquals` method - and they had
this constant in them; to set the absolute error bound to `1e-5`
I think they were making assertions on approximation results - which may be
a little bit different based on the jvm or other external reasons.
I've extracted it into a constant
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]