Search in sources :

Example 1 with TpchTableLayoutHandle

use of com.facebook.presto.tpch.TpchTableLayoutHandle in project presto by prestodb.

the class TestValidateStreamingAggregations method setup.

@BeforeClass
public void setup() {
    metadata = getQueryRunner().getMetadata();
    sqlParser = getQueryRunner().getSqlParser();
    TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
    ConnectorId connectorId = getCurrentConnectorId();
    nationTableHandle = new TableHandle(connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all())));
}
Also used : TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) ConnectorId(com.facebook.presto.spi.ConnectorId) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with TpchTableLayoutHandle

use of com.facebook.presto.tpch.TpchTableLayoutHandle in project presto by prestodb.

the class TestValidateAggregationsWithDefaultValues method setup.

@BeforeClass
public void setup() {
    metadata = getQueryRunner().getMetadata();
    builder = new PlanBuilder(TEST_SESSION, new PlanNodeIdAllocator(), metadata);
    ConnectorId connectorId = getCurrentConnectorId();
    TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
    TableHandle nationTableHandle = new TableHandle(connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all())));
    TpchColumnHandle nationkeyColumnHandle = new TpchColumnHandle("nationkey", BIGINT);
    variable = builder.variable("nationkey");
    tableScanNode = builder.tableScan(nationTableHandle, ImmutableList.of(variable), ImmutableMap.of(variable, nationkeyColumnHandle));
}
Also used : PlanNodeIdAllocator(com.facebook.presto.spi.plan.PlanNodeIdAllocator) TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) PlanBuilder(com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder) ConnectorId(com.facebook.presto.spi.ConnectorId) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with TpchTableLayoutHandle

use of com.facebook.presto.tpch.TpchTableLayoutHandle in project presto by prestodb.

the class TestCostCalculator method tableScan.

private TableScanNode tableScan(String id, List<VariableReferenceExpression> variables) {
    ImmutableMap.Builder<VariableReferenceExpression, ColumnHandle> assignments = ImmutableMap.builder();
    for (VariableReferenceExpression variable : variables) {
        assignments.put(variable, new TpchColumnHandle("orderkey", BIGINT));
    }
    TpchTableHandle tableHandle = new TpchTableHandle("orders", 1.0);
    return new TableScanNode(Optional.empty(), new PlanNodeId(id), new TableHandle(new ConnectorId("tpch"), tableHandle, TpchTransactionHandle.INSTANCE, Optional.of(new TpchTableLayoutHandle(tableHandle, TupleDomain.all()))), variables, assignments.build(), TupleDomain.all(), TupleDomain.all());
}
Also used : PlanNodeId(com.facebook.presto.spi.plan.PlanNodeId) ColumnHandle(com.facebook.presto.spi.ColumnHandle) TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) TableScanNode(com.facebook.presto.spi.plan.TableScanNode) TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) VariableReferenceExpression(com.facebook.presto.spi.relation.VariableReferenceExpression) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TableHandle(com.facebook.presto.spi.TableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) ImmutableMap(com.google.common.collect.ImmutableMap) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) ConnectorId(com.facebook.presto.spi.ConnectorId)

Example 4 with TpchTableLayoutHandle

use of com.facebook.presto.tpch.TpchTableLayoutHandle in project presto by prestodb.

the class TestPickTableLayout method setUpBeforeClass.

@BeforeClass
public void setUpBeforeClass() {
    pickTableLayout = new PickTableLayout(tester().getMetadata());
    connectorId = tester().getCurrentConnectorId();
    TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
    TpchTableHandle orderTpchTableHandle = new TpchTableHandle("orders", 1.0);
    nationTableHandle = new TableHandle(connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all())));
    ordersTableHandle = new TableHandle(connectorId, orderTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(orderTpchTableHandle, TupleDomain.all())));
}
Also used : TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) BeforeClass(org.testng.annotations.BeforeClass)

Example 5 with TpchTableLayoutHandle

use of com.facebook.presto.tpch.TpchTableLayoutHandle in project presto by prestodb.

the class TestRuntimeReorderJoinSides method setUp.

@BeforeClass
public void setUp() {
    tester = new RuleTester(ImmutableList.of(), ImmutableMap.of(), Optional.of(NODES_COUNT));
    connectorId = tester.getCurrentConnectorId();
    TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
    TpchTableHandle supplierTpchTableHandle = new TpchTableHandle("supplier", 1.0);
    nationTableHandle = new TableHandle(connectorId, nationTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(nationTpchTableHandle, TupleDomain.all())));
    supplierTableHandle = new TableHandle(connectorId, supplierTpchTableHandle, TestingTransactionHandle.create(), Optional.of(new TpchTableLayoutHandle(supplierTpchTableHandle, TupleDomain.all())));
    nationColumnHandle = new TpchColumnHandle("nationkey", BIGINT);
    suppColumnHandle = new TpchColumnHandle("suppkey", BIGINT);
}
Also used : TpchColumnHandle(com.facebook.presto.tpch.TpchColumnHandle) RuleTester(com.facebook.presto.sql.planner.iterative.rule.test.RuleTester) TableHandle(com.facebook.presto.spi.TableHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) TpchTableLayoutHandle(com.facebook.presto.tpch.TpchTableLayoutHandle) TpchTableHandle(com.facebook.presto.tpch.TpchTableHandle) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

TableHandle (com.facebook.presto.spi.TableHandle)6 TpchTableHandle (com.facebook.presto.tpch.TpchTableHandle)6 TpchTableLayoutHandle (com.facebook.presto.tpch.TpchTableLayoutHandle)6 BeforeClass (org.testng.annotations.BeforeClass)5 ConnectorId (com.facebook.presto.spi.ConnectorId)4 TpchColumnHandle (com.facebook.presto.tpch.TpchColumnHandle)4 Session (com.facebook.presto.Session)1 ColumnHandle (com.facebook.presto.spi.ColumnHandle)1 PlanNodeId (com.facebook.presto.spi.plan.PlanNodeId)1 PlanNodeIdAllocator (com.facebook.presto.spi.plan.PlanNodeIdAllocator)1 TableScanNode (com.facebook.presto.spi.plan.TableScanNode)1 VariableReferenceExpression (com.facebook.presto.spi.relation.VariableReferenceExpression)1 PlanBuilder (com.facebook.presto.sql.planner.iterative.rule.test.PlanBuilder)1 RuleTester (com.facebook.presto.sql.planner.iterative.rule.test.RuleTester)1 ImmutableMap (com.google.common.collect.ImmutableMap)1