Package com.facebook.presto.testing

Examples of com.facebook.presto.testing.LocalQueryRunner


    }

    public static LocalQueryRunner createLocalQueryRunner()
    {
        ConnectorSession session = new ConnectorSession("user", "test", "default", "default", UTC_KEY, Locale.ENGLISH, null, null);
        LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);

        // add tpch
        InMemoryNodeManager nodeManager = localQueryRunner.getNodeManager();
        localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(nodeManager, 1), ImmutableMap.<String, String>of());

        // add raptor
        RaptorConnectorFactory raptorConnectorFactory = createRaptorConnectorFactory(TPCH_CACHE_DIR, nodeManager);
        localQueryRunner.createCatalog("default", raptorConnectorFactory, ImmutableMap.<String, String>of());

        Metadata metadata = localQueryRunner.getMetadata();
        if (!metadata.getTableHandle(session, new QualifiedTableName("default", "default", "orders")).isPresent()) {
            localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders");
        }
        if (!metadata.getTableHandle(session, new QualifiedTableName("default", "default", "lineitem")).isPresent()) {
            localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem");
        }
        return localQueryRunner;
    }
View Full Code Here


                .setCatalog("tpch")
                .setSchema(TINY_SCHEMA_NAME)
                .setTimeZoneKey(UTC_KEY)
                .setLocale(ENGLISH)
                .build();
        LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);

        // add tpch
        InMemoryNodeManager nodeManager = localQueryRunner.getNodeManager();
        localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(nodeManager, 1), ImmutableMap.<String, String>of());

        return localQueryRunner;
    }
View Full Code Here

    }

    public static LocalQueryRunner createLocalQueryRunner()
    {
        ConnectorSession session = new ConnectorSession("user", "test", "tpch", TINY_SCHEMA_NAME, UTC_KEY, Locale.ENGLISH, null, null);
        LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);

        // add tpch
        InMemoryNodeManager nodeManager = localQueryRunner.getNodeManager();
        localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(nodeManager, 1), ImmutableMap.<String, String>of());

        return localQueryRunner;
    }
View Full Code Here

    }

    public static LocalQueryRunner createLocalQueryRunner(File tempDir)
    {
        ConnectorSession session = new ConnectorSession("user", "test", "hive", "tpch", UTC_KEY, Locale.ENGLISH, null, null);
        LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);

        // add tpch
        InMemoryNodeManager nodeManager = localQueryRunner.getNodeManager();
        localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(nodeManager, 1), ImmutableMap.<String, String>of());

        // add hive
        InMemoryHiveMetastore metastore = new InMemoryHiveMetastore();
        File tpchDataDir = new File(tempDir, "tpch");
        tpchDataDir.mkdir();
        metastore.createDatabase(new Database("tpch", null, tpchDataDir.toURI().toString(), null));

        HiveConnectorFactory hiveConnectorFactory = new HiveConnectorFactory(
                "hive",
                ImmutableMap.of("node.environment", "test"),
                HiveBenchmarkQueryRunner.class.getClassLoader(),
                metastore);

        Map<String, String> hiveCatalogConfig = ImmutableMap.<String, String>builder()
                .put("hive.metastore.uri", "thrift://none.invalid")
                .put("hive.max-split-size", "10GB")
                .build();

        localQueryRunner.createCatalog("hive", hiveConnectorFactory, hiveCatalogConfig);

        localQueryRunner.execute("CREATE TABLE orders AS SELECT * FROM tpch.sf1.orders");
        localQueryRunner.execute("CREATE TABLE lineitem AS SELECT * FROM tpch.sf1.lineitem");
        return localQueryRunner;
    }
View Full Code Here

    private static final ConnectorSession SESSION = new ConnectorSession("user", "test", "tpch", TINY_SCHEMA_NAME, UTC_KEY, ENGLISH, null, null);
    private final LocalQueryRunner queryRunner;

    public TestWindowFunctions()
    {
        queryRunner = new LocalQueryRunner(SESSION);
        queryRunner.createCatalog("tpch", new TpchConnectorFactory(queryRunner.getNodeManager(), 1), ImmutableMap.<String, String>of());
    }
View Full Code Here

    }

    public FunctionAssertions(ConnectorSession session)
    {
        this.session = checkNotNull(session, "session is null");
        runner = new LocalQueryRunner(session);
        metadata = runner.getMetadata();
        compiler = new ExpressionCompiler(metadata);
    }
View Full Code Here

    private LocalQueryRunner runner;

    public TestHiddenColumns()
    {
        runner = new LocalQueryRunner(SESSION);
        runner.createCatalog(SESSION.getCatalog(), new TpchConnectorFactory(runner.getNodeManager(), 1), ImmutableMap.<String, String>of());
    }
View Full Code Here

    private LocalQueryRunner runner;

    public TestHiddenColumns()
    {
        runner = new LocalQueryRunner(SESSION);
        runner.createCatalog(SESSION.getCatalog(), new TpchConnectorFactory(runner.getNodeManager(), 1), ImmutableMap.<String, String>of());
    }
View Full Code Here

    }

    public FunctionAssertions(ConnectorSession session)
    {
        this.session = checkNotNull(session, "session is null");
        runner = new LocalQueryRunner(session);
        metadata = runner.getMetadata();
        compiler = new ExpressionCompiler(metadata);
    }
View Full Code Here

    private static final ConnectorSession SESSION = new ConnectorSession("user", "test", "tpch", TINY_SCHEMA_NAME, UTC_KEY, ENGLISH, null, null);
    private final LocalQueryRunner queryRunner;

    public TestWindowFunctions()
    {
        queryRunner = new LocalQueryRunner(SESSION);
        queryRunner.createCatalog("tpch", new TpchConnectorFactory(queryRunner.getNodeManager(), 1), ImmutableMap.<String, String>of());
    }
View Full Code Here

TOP

Related Classes of com.facebook.presto.testing.LocalQueryRunner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.