use of io.prestosql.operator.CubeRangeCanonicalizer in project hetu-core by openlookeng.
the class TestExpressionDomainTranslator method mergeAndAssert.
private Expression mergeAndAssert(boolean contains, Expression expression, Expression partExpression) {
CubeRangeCanonicalizer canonicalizer = new CubeRangeCanonicalizer(metadata, TEST_SESSION, TYPES);
Expression transformed = canonicalizer.mergePredicates(expression);
ExpressionDomainTranslator.ExtractionResult expressionTD = ExpressionDomainTranslator.fromPredicate(metadata, TEST_SESSION, transformed, TYPES);
Assert.assertEquals(expressionTD.getRemainingExpression(), BooleanLiteral.TRUE_LITERAL, "Still some part of expression not converted into TupleDomain");
ExpressionDomainTranslator.ExtractionResult partTD = ExpressionDomainTranslator.fromPredicate(metadata, TEST_SESSION, partExpression, TYPES);
Assert.assertEquals(partTD.getRemainingExpression(), BooleanLiteral.TRUE_LITERAL, "Still some part of expression not converted into TupleDomain");
Assert.assertEquals(contains, expressionTD.getTupleDomain().contains(partTD.getTupleDomain()));
return transformed;
}
Aggregations