Search in sources :

Example 1 with ArithmeticUnaryExpression

use of com.facebook.presto.sql.tree.ArithmeticUnaryExpression in project presto by prestodb.

the class TestEliminateCrossJoins method testGiveUpOnNonIdentityProjections.

@Test
public void testGiveUpOnNonIdentityProjections() {
    PlanNode plan = join(project(join(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(com.facebook.presto.sql.planner.plan.PlanNode) SymbolReference(com.facebook.presto.sql.tree.SymbolReference) ArithmeticUnaryExpression(com.facebook.presto.sql.tree.ArithmeticUnaryExpression) Test(org.testng.annotations.Test)

Aggregations

PlanNode (com.facebook.presto.sql.planner.plan.PlanNode)1 ArithmeticUnaryExpression (com.facebook.presto.sql.tree.ArithmeticUnaryExpression)1 SymbolReference (com.facebook.presto.sql.tree.SymbolReference)1 Test (org.testng.annotations.Test)1