Search in sources :

Example 1 with ArithmeticUnaryExpression

use of io.prestosql.sql.tree.ArithmeticUnaryExpression in project hetu-core by openlookeng.

the class TestEliminateCrossJoins method testGiveUpOnNonIdentityProjections.

@Test
public void testGiveUpOnNonIdentityProjections() {
    PlanNode plan = joinNode(projectNode(joinNode(values(symbol("a1")), values(symbol("b"))), symbol("a2"), new ArithmeticUnaryExpression(MINUS, new SymbolReference("a1"))), values(symbol("c")), symbol("a2"), symbol("c"), symbol("c"), symbol("b"));
    assertEquals(JoinGraph.buildFrom(plan).size(), 2);
}
Also used : PlanNode(io.prestosql.spi.plan.PlanNode) SymbolReference(io.prestosql.sql.tree.SymbolReference) ArithmeticUnaryExpression(io.prestosql.sql.tree.ArithmeticUnaryExpression) BaseRuleTest(io.prestosql.sql.planner.iterative.rule.test.BaseRuleTest) Test(org.testng.annotations.Test)

Aggregations

PlanNode (io.prestosql.spi.plan.PlanNode)1 BaseRuleTest (io.prestosql.sql.planner.iterative.rule.test.BaseRuleTest)1 ArithmeticUnaryExpression (io.prestosql.sql.tree.ArithmeticUnaryExpression)1 SymbolReference (io.prestosql.sql.tree.SymbolReference)1 Test (org.testng.annotations.Test)1