Search in sources :

Example 26 with TpchConnectorFactory

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

the class TestSpatialJoinPlanning method createQueryRunner.

private static LocalQueryRunner createQueryRunner() {
    LocalQueryRunner queryRunner = new LocalQueryRunner(testSessionBuilder().setCatalog("memory").setSchema("default").build());
    queryRunner.installPlugin(new GeoPlugin());
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of());
    queryRunner.execute(format("CREATE TABLE kdb_tree AS SELECT '%s' AS v", KDB_TREE_JSON));
    return queryRunner;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) MemoryConnectorFactory(com.facebook.presto.plugin.memory.MemoryConnectorFactory) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner)

Example 27 with TpchConnectorFactory

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

the class TestTpchLocalStats method setUp.

@BeforeClass
public void setUp() {
    Session defaultSession = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME).setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false").setSystemProperty(PRINT_STATS_FOR_NON_JOIN_QUERY, "true").build();
    LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession);
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name()));
    statisticsAssertion = new StatisticsAssertion(queryRunner);
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) StatisticsAssertion(com.facebook.presto.tests.statistics.StatisticsAssertion) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session) BeforeClass(org.testng.annotations.BeforeClass)

Example 28 with TpchConnectorFactory

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

the class TestQueryPlanDeterminism method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() {
    Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).build();
    LocalQueryRunner localQueryRunner = new LocalQueryRunner(defaultSession);
    // add the tpch catalog
    // local queries run directly against the generator
    localQueryRunner.createCatalog(defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
    localQueryRunner.getMetadata().registerBuiltInFunctions(CUSTOM_FUNCTIONS);
    SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager();
    sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
    sessionPropertyManager.addConnectorSessionProperties(new ConnectorId(TESTING_CATALOG), TEST_CATALOG_PROPERTIES);
    return localQueryRunner;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) SessionPropertyManager(com.facebook.presto.metadata.SessionPropertyManager) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session) ConnectorId(com.facebook.presto.spi.ConnectorId)

Example 29 with TpchConnectorFactory

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

the class TestDictionaryAggregation method createQueryRunner.

@Override
protected QueryRunner createQueryRunner() {
    LocalQueryRunner queryRunner = new LocalQueryRunner(testSessionBuilder().setSystemProperty(DICTIONARY_AGGREGATION, "true").setSystemProperty(REORDER_JOINS, // no JOIN reordering
    "false").build());
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner)

Example 30 with TpchConnectorFactory

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

the class RaptorBenchmarkQueryRunner method createLocalQueryRunner.

public static LocalQueryRunner createLocalQueryRunner() {
    Session session = testSessionBuilder().setCatalog("raptor").setSchema("benchmark").build();
    LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
    // add tpch
    localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    // add raptor
    ConnectorFactory raptorConnectorFactory = getOnlyElement(new RaptorPlugin().getConnectorFactories());
    Map<String, String> config = createRaptorConfig(TPCH_CACHE_DIR);
    localQueryRunner.createCatalog("raptor", raptorConnectorFactory, config);
    if (!localQueryRunner.tableExists(session, "orders")) {
        localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders");
    }
    if (!localQueryRunner.tableExists(session, "lineitem")) {
        localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem");
    }
    return localQueryRunner;
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) ConnectorFactory(com.facebook.presto.spi.connector.ConnectorFactory) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session)

Aggregations

TpchConnectorFactory (com.facebook.presto.tpch.TpchConnectorFactory)30 LocalQueryRunner (com.facebook.presto.testing.LocalQueryRunner)25 Session (com.facebook.presto.Session)18 BeforeClass (org.testng.annotations.BeforeClass)6 InformationSchemaConnector (com.facebook.presto.connector.informationSchema.InformationSchemaConnector)4 SystemConnector (com.facebook.presto.connector.system.SystemConnector)4 SessionPropertyManager (com.facebook.presto.metadata.SessionPropertyManager)4 Connector (com.facebook.presto.spi.connector.Connector)4 TestingConnectorContext (com.facebook.presto.testing.TestingConnectorContext)4 Test (org.testng.annotations.Test)4 CatalogManager (com.facebook.presto.metadata.CatalogManager)3 MemoryConnectorFactory (com.facebook.presto.plugin.memory.MemoryConnectorFactory)3 ConnectorId (com.facebook.presto.spi.ConnectorId)3 ConnectorMetadata (com.facebook.presto.spi.connector.ConnectorMetadata)3 TestingSession.testSessionBuilder (com.facebook.presto.testing.TestingSession.testSessionBuilder)3 SessionBuilder (com.facebook.presto.Session.SessionBuilder)2 ConnectorId (com.facebook.presto.connector.ConnectorId)2 QueryId (com.facebook.presto.spi.QueryId)2 ConnectorFactory (com.facebook.presto.spi.connector.ConnectorFactory)2 MemoryPoolId (com.facebook.presto.spi.memory.MemoryPoolId)2