use of io.trino.plugin.tpch.TpchTableHandle in project trino by trinodb.
the class TestCostCalculator method tableScan.
private TableScanNode tableScan(String id, String... symbols) {
List<Symbol> symbolsList = Arrays.stream(symbols).map(Symbol::new).collect(toImmutableList());
ImmutableMap.Builder<Symbol, ColumnHandle> assignments = ImmutableMap.builder();
for (Symbol symbol : symbolsList) {
assignments.put(symbol, new TpchColumnHandle("orderkey", BIGINT));
}
TpchTableHandle tableHandle = new TpchTableHandle("sf1", "orders", 1.0);
return new TableScanNode(new PlanNodeId(id), new TableHandle(new CatalogName("tpch"), tableHandle, INSTANCE), symbolsList, assignments.buildOrThrow(), TupleDomain.all(), Optional.empty(), false, Optional.of(false));
}
use of io.trino.plugin.tpch.TpchTableHandle in project trino by trinodb.
the class TestDynamicFiltersChecker method setup.
@BeforeClass
public void setup() {
plannerContext = getQueryRunner().getPlannerContext();
metadata = plannerContext.getMetadata();
builder = new PlanBuilder(new PlanNodeIdAllocator(), metadata, TEST_SESSION);
CatalogName catalogName = getCurrentConnectorId();
TableHandle lineitemTableHandle = new TableHandle(catalogName, new TpchTableHandle("sf1", "lineitem", 1.0), TestingTransactionHandle.create());
lineitemOrderKeySymbol = builder.symbol("LINEITEM_OK", BIGINT);
lineitemTableScanNode = builder.tableScan(lineitemTableHandle, ImmutableList.of(lineitemOrderKeySymbol), ImmutableMap.of(lineitemOrderKeySymbol, new TpchColumnHandle("orderkey", BIGINT)));
TableHandle ordersTableHandle = new TableHandle(catalogName, new TpchTableHandle("sf1", "orders", 1.0), TestingTransactionHandle.create());
ordersOrderKeySymbol = builder.symbol("ORDERS_OK", BIGINT);
ordersTableScanNode = builder.tableScan(ordersTableHandle, ImmutableList.of(ordersOrderKeySymbol), ImmutableMap.of(ordersOrderKeySymbol, new TpchColumnHandle("orderkey", BIGINT)));
}
use of io.trino.plugin.tpch.TpchTableHandle in project trino by trinodb.
the class TestValidateAggregationsWithDefaultValues method setup.
@BeforeClass
public void setup() {
plannerContext = getQueryRunner().getPlannerContext();
builder = new PlanBuilder(new PlanNodeIdAllocator(), plannerContext.getMetadata(), TEST_SESSION);
CatalogName catalogName = getCurrentConnectorId();
TableHandle nationTableHandle = new TableHandle(catalogName, new TpchTableHandle("sf1", "nation", 1.0), TestingTransactionHandle.create());
TpchColumnHandle nationkeyColumnHandle = new TpchColumnHandle("nationkey", BIGINT);
symbol = new Symbol("nationkey");
tableScanNode = builder.tableScan(nationTableHandle, ImmutableList.of(symbol), ImmutableMap.of(symbol, nationkeyColumnHandle));
}
use of io.trino.plugin.tpch.TpchTableHandle in project trino by trinodb.
the class TestValidateStreamingAggregations method setup.
@BeforeClass
public void setup() {
plannerContext = getQueryRunner().getPlannerContext();
typeAnalyzer = createTestingTypeAnalyzer(plannerContext);
CatalogName catalogName = getCurrentConnectorId();
nationTableHandle = new TableHandle(catalogName, new TpchTableHandle("sf1", "nation", 1.0), TpchTransactionHandle.INSTANCE);
}
use of io.trino.plugin.tpch.TpchTableHandle in project trino by trinodb.
the class TestPushPredicateIntoTableScan method setUpBeforeClass.
@BeforeClass
public void setUpBeforeClass() {
pushPredicateIntoTableScan = new PushPredicateIntoTableScan(tester().getPlannerContext(), createTestingTypeAnalyzer(tester().getPlannerContext()));
CatalogName catalogName = tester().getCurrentConnectorId();
tester().getQueryRunner().createCatalog(MOCK_CATALOG, createMockFactory(), ImmutableMap.of());
TpchTableHandle nation = new TpchTableHandle("sf1", "nation", 1.0);
nationTableHandle = new TableHandle(catalogName, nation, TpchTransactionHandle.INSTANCE);
TpchTableHandle orders = new TpchTableHandle("sf1", "orders", 1.0);
ordersTableHandle = new TableHandle(catalogName, orders, TpchTransactionHandle.INSTANCE);
}
Aggregations