case EQUAL:
Long equalValue = DoubleMath.roundToLong(value, FLOOR);
if (equalValue.doubleValue() != value) {
// Return something that is false for all non-null values
return and(new ComparisonExpression(EQUAL, reference, new LongLiteral("0")),
new ComparisonExpression(NOT_EQUAL, reference, new LongLiteral("0")));
}
return new ComparisonExpression(comparison.getType(), reference, toExpression(equalValue, BIGINT));
case NOT_EQUAL:
Long notEqualValue = DoubleMath.roundToLong(value, FLOOR);
if (notEqualValue.doubleValue() != value) {
// Return something that is true for all non-null values
return or(new ComparisonExpression(EQUAL, reference, new LongLiteral("0")),
new ComparisonExpression(NOT_EQUAL, reference, new LongLiteral("0")));
}
return new ComparisonExpression(comparison.getType(), reference, toExpression(notEqualValue, BIGINT));
case IS_DISTINCT_FROM:
Long distinctValue = DoubleMath.roundToLong(value, FLOOR);