Search in sources :

Example 1 with ProjectReduceExpressionsRule

use of org.apache.calcite.rel.rules.ReduceExpressionsRule.ProjectReduceExpressionsRule in project calcite by apache.

the class RelOptRulesTest method testReduceNullableToNotNull2.

/**
 * Test case that reduces a nullable expression to a NOT NULL literal.
 */
@Test
void testReduceNullableToNotNull2() {
    final ProjectReduceExpressionsRule rule = CoreRules.PROJECT_REDUCE_EXPRESSIONS.config.withOperandFor(LogicalProject.class).withMatchNullability(false).as(ProjectReduceExpressionsRule.ProjectReduceExpressionsRuleConfig.class).toRule();
    checkReduceNullableToNotNull(rule);
}
Also used : ProjectReduceExpressionsRule(org.apache.calcite.rel.rules.ReduceExpressionsRule.ProjectReduceExpressionsRule) LogicalProject(org.apache.calcite.rel.logical.LogicalProject) Test(org.junit.jupiter.api.Test)

Aggregations

LogicalProject (org.apache.calcite.rel.logical.LogicalProject)1 ProjectReduceExpressionsRule (org.apache.calcite.rel.rules.ReduceExpressionsRule.ProjectReduceExpressionsRule)1 Test (org.junit.jupiter.api.Test)1