Search in sources :

Example 11 with UnionNode

use of io.prestosql.spi.plan.UnionNode in project hetu-core by openlookeng.

the class TestTypeValidator method testValidUnion.

@Test
public void testValidUnion() {
    Symbol outputSymbol = planSymbolAllocator.newSymbol("output", DATE);
    ListMultimap<Symbol, Symbol> mappings = ImmutableListMultimap.<Symbol, Symbol>builder().put(outputSymbol, columnD).put(outputSymbol, columnD).build();
    PlanNode node = new UnionNode(newId(), ImmutableList.of(baseTableScan, baseTableScan), mappings, ImmutableList.copyOf(mappings.keySet()));
    assertTypesValid(node);
}
Also used : PlanNode(io.prestosql.spi.plan.PlanNode) UnionNode(io.prestosql.spi.plan.UnionNode) Symbol(io.prestosql.spi.plan.Symbol) Test(org.testng.annotations.Test)

Aggregations

UnionNode (io.prestosql.spi.plan.UnionNode)11 PlanNode (io.prestosql.spi.plan.PlanNode)10 Symbol (io.prestosql.spi.plan.Symbol)9 ImmutableList (com.google.common.collect.ImmutableList)5 Test (org.testng.annotations.Test)5 ImmutableListMultimap (com.google.common.collect.ImmutableListMultimap)4 Assignments (io.prestosql.spi.plan.Assignments)3 ProjectNode (io.prestosql.spi.plan.ProjectNode)3 Type (io.prestosql.spi.type.Type)3 ImmutableMap (com.google.common.collect.ImmutableMap)2 CallExpression (io.prestosql.spi.relation.CallExpression)2 RowExpression (io.prestosql.spi.relation.RowExpression)2 VariableReferenceExpression (io.prestosql.spi.relation.VariableReferenceExpression)2 SetOperationNodeUtils.sourceSymbolMap (io.prestosql.sql.planner.optimizations.SetOperationNodeUtils.sourceSymbolMap)2 OriginalExpressionUtils.castToRowExpression (io.prestosql.sql.relational.OriginalExpressionUtils.castToRowExpression)2 ComparisonExpression (io.prestosql.sql.tree.ComparisonExpression)2 Expression (io.prestosql.sql.tree.Expression)2 Map (java.util.Map)2 Preconditions.checkArgument (com.google.common.base.Preconditions.checkArgument)1 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1