use of io.trino.testing.DistributedQueryRunner in project trino by trinodb.
the class GeoQueryRunner method createQueryRunner.
private static DistributedQueryRunner createQueryRunner(Map<String, String> extraProperties) throws Exception {
DistributedQueryRunner queryRunner = DistributedQueryRunner.builder(testSessionBuilder().build()).setExtraProperties(extraProperties).build();
queryRunner.installPlugin(new GeoPlugin());
return queryRunner;
}
use of io.trino.testing.DistributedQueryRunner in project trino by trinodb.
the class GeoQueryRunner method main.
public static void main(String[] args) throws Exception {
Logging.initialize();
DistributedQueryRunner queryRunner = createQueryRunner(ImmutableMap.of("http-server.http.port", "8080"));
Logger log = Logger.get(GeoQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
use of io.trino.testing.DistributedQueryRunner in project trino by trinodb.
the class SheetsQueryRunner method main.
public static void main(String[] args) throws Exception {
Logging.initialize();
DistributedQueryRunner queryRunner = createSheetsQueryRunner(ImmutableMap.of("http-server.http.port", "8080"), ImmutableMap.of());
Logger log = Logger.get(SheetsQueryRunner.class);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
use of io.trino.testing.DistributedQueryRunner in project trino by trinodb.
the class BaseHiveConnectorTest method doTestParquetTimestampPredicatePushdown.
private void doTestParquetTimestampPredicatePushdown(Session baseSession, HiveTimestampPrecision timestampPrecision, LocalDateTime value) {
Session session = withTimestampPrecision(baseSession, timestampPrecision);
String tableName = "test_parquet_timestamp_predicate_pushdown_" + randomTableSuffix();
assertUpdate("DROP TABLE IF EXISTS " + tableName);
assertUpdate("CREATE TABLE " + tableName + " (t TIMESTAMP) WITH (format = 'PARQUET')");
assertUpdate(session, format("INSERT INTO %s VALUES (%s)", tableName, formatTimestamp(value)), 1);
assertQuery(session, "SELECT * FROM " + tableName, format("VALUES (%s)", formatTimestamp(value)));
DistributedQueryRunner queryRunner = (DistributedQueryRunner) getQueryRunner();
ResultWithQueryId<MaterializedResult> queryResult = queryRunner.executeWithQueryId(session, format("SELECT * FROM %s WHERE t < %s", tableName, formatTimestamp(value)));
assertEquals(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes(), 0);
queryResult = queryRunner.executeWithQueryId(session, format("SELECT * FROM %s WHERE t > %s", tableName, formatTimestamp(value)));
assertEquals(getQueryInfo(queryRunner, queryResult).getQueryStats().getProcessedInputDataSize().toBytes(), 0);
assertQueryStats(session, format("SELECT * FROM %s WHERE t = %s", tableName, formatTimestamp(value)), queryStats -> {
assertThat(queryStats.getProcessedInputDataSize().toBytes()).isGreaterThan(0);
}, results -> {
});
}
use of io.trino.testing.DistributedQueryRunner in project trino by trinodb.
the class HiveQueryRunner method main.
public static void main(String[] args) throws Exception {
Optional<Path> baseDataDir = Optional.empty();
if (args.length > 0) {
if (args.length != 1) {
System.err.println("usage: HiveQueryRunner [baseDataDir]");
System.exit(1);
}
Path path = Paths.get(args[0]);
createDirectories(path);
baseDataDir = Optional.of(path);
}
DistributedQueryRunner queryRunner = HiveQueryRunner.builder().setExtraProperties(ImmutableMap.of("http-server.http.port", "8080")).setSkipTimezoneSetup(true).setHiveProperties(ImmutableMap.of()).setInitialTables(TpchTable.getTables()).setBaseDataDir(baseDataDir).setTpcdsCatalogEnabled(true).setSecurity(ALLOW_ALL).build();
Thread.sleep(10);
log.info("======== SERVER STARTED ========");
log.info("\n====\n%s\n====", queryRunner.getCoordinator().getBaseUrl());
}
Aggregations