use of com.facebook.presto.spi.TableHandle 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);
}
use of com.facebook.presto.spi.TableHandle in project presto by prestodb.
the class TestValidateStreamingJoins method setup.
@BeforeClass
public void setup() {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("local").setSchema("tiny");
testSession = sessionBuilder.build();
metadata = getQueryRunner().getMetadata();
sqlParser = getQueryRunner().getSqlParser();
TpchTableHandle nationTpchTableHandle = new TpchTableHandle("nation", 1.0);
TpchTableHandle supplierTpchTableHandle = new TpchTableHandle("supplier", 1.0);
ConnectorId connectorId = getCurrentConnectorId();
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);
}
use of com.facebook.presto.spi.TableHandle in project presto by prestodb.
the class TestPrestoSparkLauncherIntegrationSmokeTest method dropTable.
private void dropTable(String table) {
// LocalQueryRunner doesn't support DROP TABLE
localQueryRunner.inTransaction(localQueryRunner.getDefaultSession(), transactionSession -> {
Metadata metadata = localQueryRunner.getMetadata();
TableHandle tableHandle = metadata.getTableHandle(transactionSession, new QualifiedObjectName("hive", "default", table)).get();
metadata.dropTable(transactionSession, tableHandle);
return null;
});
}
use of com.facebook.presto.spi.TableHandle in project presto by prestodb.
the class TestMetadataManager method testGetTableStatisticsDoesNotThrow.
@Test
public void testGetTableStatisticsDoesNotThrow() {
Session session = testSessionBuilder().setSystemProperty("ignore_stats_calculator_failures", "true").build();
TableHandle tableHandle = new TableHandle(new ConnectorId("upper_case_schema_catalog"), new ConnectorTableHandle() {
}, TestingTransactionHandle.create(), Optional.empty());
TransactionBuilder.transaction(queryRunner.getTransactionManager(), queryRunner.getAccessControl()).execute(session, transactionSession -> {
queryRunner.getMetadata().getCatalogHandle(transactionSession, "upper_case_schema_catalog");
assertEquals(queryRunner.getMetadata().getTableStatistics(transactionSession, tableHandle, ImmutableList.of(), alwaysTrue()), TableStatistics.empty());
});
}
use of com.facebook.presto.spi.TableHandle in project presto by prestodb.
the class TestMetadataManager method setUp.
@BeforeClass
public void setUp() throws Exception {
queryRunner = TpchQueryRunnerBuilder.builder().build();
queryRunner.installPlugin(new Plugin() {
@Override
public Iterable<ConnectorFactory> getConnectorFactories() {
MockConnectorFactory connectorFactory = MockConnectorFactory.builder().withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")).withListTables((session, schemaNameOrNull) -> {
throw new UnsupportedOperationException();
}).withGetViews((session, prefix) -> ImmutableMap.of()).withGetColumnHandles((session, tableHandle) -> {
throw new UnsupportedOperationException();
}).withGetTableStatistics(() -> {
throw new UnsupportedOperationException();
}).build();
return ImmutableList.of(connectorFactory);
}
});
queryRunner.createCatalog("upper_case_schema_catalog", "mock");
metadataManager = (MetadataManager) queryRunner.getMetadata();
}
Aggregations