use of io.prestosql.spi.plan.PlanNode in project hetu-core by openlookeng.
the class TestPruneCrossJoinColumns method buildProjectedCrossJoin.
private static PlanNode buildProjectedCrossJoin(PlanBuilder p, Predicate<Symbol> projectionFilter) {
Symbol leftValue = p.symbol("leftValue");
Symbol rightValue = p.symbol("rightValue");
List<Symbol> outputs = ImmutableList.of(leftValue, rightValue);
return p.project(Assignments.copyOf(outputs.stream().filter(projectionFilter).collect(Collectors.toMap(v -> v, v -> p.variable(v.getName())))), p.join(JoinNode.Type.INNER, p.values(leftValue), p.values(rightValue), ImmutableList.of(), outputs, Optional.empty(), Optional.empty(), Optional.empty()));
}
use of io.prestosql.spi.plan.PlanNode in project hetu-core by openlookeng.
the class TestPruneIndexSourceColumns method buildProjectedIndexSource.
private static PlanNode buildProjectedIndexSource(PlanBuilder p, Predicate<Symbol> projectionFilter) {
Symbol orderkey = p.symbol("orderkey", INTEGER);
Symbol custkey = p.symbol("custkey", INTEGER);
Symbol totalprice = p.symbol("totalprice", DOUBLE);
ColumnHandle orderkeyHandle = new TpchColumnHandle(orderkey.getName(), INTEGER);
ColumnHandle custkeyHandle = new TpchColumnHandle(custkey.getName(), INTEGER);
ColumnHandle totalpriceHandle = new TpchColumnHandle(totalprice.getName(), DOUBLE);
return p.project(Assignments.copyOf(ImmutableList.of(orderkey, custkey, totalprice).stream().filter(projectionFilter).collect(Collectors.toMap(v -> v, v -> p.variable(v.getName())))), p.indexSource(new TableHandle(new CatalogName("local"), new TpchTableHandle("orders", TINY_SCALE_FACTOR), TpchTransactionHandle.INSTANCE, Optional.empty()), ImmutableSet.of(orderkey, custkey), ImmutableList.of(orderkey, custkey, totalprice), ImmutableMap.of(orderkey, orderkeyHandle, custkey, custkeyHandle, totalprice, totalpriceHandle), TupleDomain.fromFixedValues(ImmutableMap.of(totalpriceHandle, asNull(DOUBLE)))));
}
use of io.prestosql.spi.plan.PlanNode in project hetu-core by openlookeng.
the class TestExternalFunctionPushDownChecker method testWindowNode.
@Test
public void testWindowNode() {
WindowNode.Frame frame = new WindowNode.Frame(Types.WindowFrameType.RANGE, UNBOUNDED_PRECEDING, Optional.empty(), CURRENT_ROW, Optional.empty(), Optional.empty(), Optional.empty());
PlanNode root = builder.window(new WindowNode.Specification(ImmutableList.of(columnA), Optional.empty()), ImmutableMap.of(columnB, new WindowNode.Function(sumCall, ImmutableList.of(), frame)), builder.values(columnA));
validatePlan(root);
}
use of io.prestosql.spi.plan.PlanNode in project hetu-core by openlookeng.
the class TestExternalFunctionPushDownChecker method testAggregationNodeWithExternalCall.
@Test(expectedExceptions = ExternalFunctionPushDownChecker.IllegalExternalFunctionUsageException.class, expectedExceptionsMessageRegExp = "The external function jdbc.v1.foo does not support to push down to data source for this query.")
public void testAggregationNodeWithExternalCall() {
PlanNode root = builder.aggregation(a -> a.globalGrouping().addAggregation(columnA, externalFooCall1).source(builder.values(columnB)));
validatePlan(root);
}
use of io.prestosql.spi.plan.PlanNode in project hetu-core by openlookeng.
the class TestExternalFunctionPushDownChecker method testTableDeleteNode.
@Test
public void testTableDeleteNode() {
PlanNode node = new TableDeleteNode(idAllocator.getNextId(), builder.values(), Optional.of(sumCall), tableHandle, ImmutableMap.of(), columnA);
validatePlan(node);
}
Aggregations