use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.
the class HiveBenchmarkQueryRunner method main.
public static void main(String[] args) throws IOException {
String outputDirectory = requireNonNull(System.getProperty("outputDirectory"), "Must specify -DoutputDirectory=...");
File tempDir = createTempDirectory("HiveBenchmarkQueryRunner").toFile();
try (LocalQueryRunner localQueryRunner = createLocalQueryRunner(tempDir)) {
new BenchmarkSuite(localQueryRunner, outputDirectory).runAllBenchmarks();
} finally {
deleteRecursively(tempDir.toPath(), ALLOW_INSECURE);
}
}
use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.
the class HiveBenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner(File tempDir) {
Session session = testSessionBuilder().setCatalog("hive").setSchema("tpch").build();
LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
// add hive
File hiveDir = new File(tempDir, "hive_data");
HiveMetastore metastore = createTestingFileHiveMetastore(hiveDir);
HiveIdentity identity = new HiveIdentity(SESSION);
metastore.createDatabase(identity, Database.builder().setDatabaseName("tpch").setOwnerName("public").setOwnerType(PrincipalType.ROLE).build());
HiveConnectorFactory hiveConnectorFactory = new HiveConnectorFactory("hive", HiveBenchmarkQueryRunner.class.getClassLoader(), Optional.of(metastore));
Map<String, String> hiveCatalogConfig = ImmutableMap.<String, String>builder().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;
}
use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.
the class TestTpcdsLocalStats method setUp.
@BeforeClass
public void setUp() {
Session defaultSession = testSessionBuilder().setCatalog("tpcds").setSchema("sf1").build();
LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession);
queryRunner.createCatalog("tpcds", new TpcdsConnectorFactory(), emptyMap());
statisticsAssertion = new StatisticsAssertion(queryRunner);
}
use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.
the class TestLocalQueries method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner() {
Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).setSystemProperty(PUSH_PARTIAL_AGGREGATION_THROUGH_JOIN, "true").setSystemProperty(ENABLE_DYNAMIC_FILTERING, "true").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().getFunctionAndTypeManager().registerBuiltInFunctions(CUSTOM_FUNCTIONS);
SessionPropertyManager sessionPropertyManager = localQueryRunner.getMetadata().getSessionPropertyManager();
sessionPropertyManager.addSystemSessionProperties(TEST_SYSTEM_PROPERTIES);
sessionPropertyManager.addConnectorSessionProperties(new CatalogName(TESTING_CATALOG), TEST_CATALOG_PROPERTIES);
return localQueryRunner;
}
Aggregations