com.facebook.presto.testing.QueryRunner Java Examples
The following examples show how to use
com.facebook.presto.testing.QueryRunner.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: KuduQueryRunnerFactory.java From presto-kudu with Apache License 2.0 | 6 votes |
public static QueryRunner createKuduQueryRunner(String schema) throws Exception { QueryRunner runner = null; String kuduSchema = schema; try { runner = DistributedQueryRunner.builder(createSession(kuduSchema)).setNodeCount(3).build(); installKuduConnector(runner, kuduSchema); return runner; } catch (Throwable e) { closeAllSuppress(e, runner); throw e; } }
Example #2
Source File: KuduQueryRunnerFactory.java From presto-kudu with Apache License 2.0 | 6 votes |
public static QueryRunner createKuduQueryRunnerTpch(Iterable<TpchTable<?>> tables) throws Exception { DistributedQueryRunner runner = null; String kuduSchema = "tpch"; try { runner = DistributedQueryRunner.builder(createSession(kuduSchema)).setNodeCount(3).build(); runner.installPlugin(new TpchPlugin()); runner.createCatalog("tpch", "tpch"); installKuduConnector(runner, kuduSchema); copyTpchTables(runner, "tpch", TINY_SCHEMA_NAME, createSession(kuduSchema), tables); return runner; } catch (Throwable e) { closeAllSuppress(e, runner); throw e; } }
Example #3
Source File: TestUtils.java From presto-kinesis with Apache License 2.0 | 6 votes |
/** * Install the plugin into the given query runner, using the mock client and the given table descriptions. * * The plug in is returned so that the injector can be accessed and other setup items tested. * * @param queryRunner * @param streamDescriptions * @return */ public static KinesisPlugin installKinesisPlugin(QueryRunner queryRunner, Map<SchemaTableName, KinesisStreamDescription> streamDescriptions) { KinesisPlugin kinesisPlugin = createPluginInstance(); // Note: function literal with provided descriptions instead of KinesisTableDescriptionSupplier: kinesisPlugin.setTableDescriptionSupplier(() -> streamDescriptions); kinesisPlugin.setAltProviderClass(KinesisTestClientManager.class); queryRunner.installPlugin(kinesisPlugin); Map<String, String> kinesisConfig = ImmutableMap.of( "kinesis.default-schema", "default", "kinesis.access-key", "", "kinesis.secret-key", ""); queryRunner.createCatalog("kinesis", "kinesis", kinesisConfig); return kinesisPlugin; }
Example #4
Source File: KuduQueryRunnerFactory.java From presto-kudu with Apache License 2.0 | 5 votes |
private static void installKuduConnector(QueryRunner runner, String schema) { String masterAddresses = System.getProperty("kudu.client.master-addresses", "localhost:7051"); Map<String, String> properties = ImmutableMap.of( "kudu.client.master-addresses", masterAddresses); runner.installPlugin(new KuduPlugin()); runner.createCatalog("kudu", "kudu", properties); runner.execute("DROP SCHEMA IF EXISTS " + schema); runner.execute("CREATE SCHEMA " + schema); }
Example #5
Source File: TestUtils.java From presto-kinesis with Apache License 2.0 | 5 votes |
/** * Install the plug in into the given query runner, using normal setup but with the given table descriptions. * * Note that this uses the actual client and will incur charges from AWS when run. Mainly for full * integration tests. * * @param queryRunner * @param streamDescriptions * @param accessKey * @param secretKey */ public static void installKinesisPlugin(QueryRunner queryRunner, Map<SchemaTableName, KinesisStreamDescription> streamDescriptions, String accessKey, String secretKey) { KinesisPlugin kinesisPlugin = createPluginInstance(); // Note: function literal with provided descriptions instead of KinesisTableDescriptionSupplier: kinesisPlugin.setTableDescriptionSupplier(() -> streamDescriptions); queryRunner.installPlugin(kinesisPlugin); Map<String, String> kinesisConfig = ImmutableMap.of( "kinesis.default-schema", "default", "kinesis.access-key", accessKey, "kinesis.secret-key", secretKey); queryRunner.createCatalog("kinesis", "kinesis", kinesisConfig); }
Example #6
Source File: KuduQueryRunnerFactory.java From presto-kudu with Apache License 2.0 | 4 votes |
public static QueryRunner createKuduQueryRunnerTpch(TpchTable<?>... tables) throws Exception { return createKuduQueryRunnerTpch(ImmutableList.copyOf(tables)); }
Example #7
Source File: TestBloomFilterQueries.java From presto-bloomfilter with Apache License 2.0 | 4 votes |
public QueryRunner get() { return queryRunner; }