public void installPlugin(Plugin plugin) { localQueryRunner.installPlugin(plugin); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkSpatialJoin.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute(format("CREATE TABLE memory.default.polygons AS SELECT * FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkGeometryAggregations.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute( format("CREATE TABLE memory.default.us_states AS SELECT ST_GeometryFromText(t.wkt) AS geom FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
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; }
public void installPlugin(Plugin plugin) { localQueryRunner.installPlugin(plugin); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkSpatialJoin.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute(format("CREATE TABLE memory.default.polygons AS SELECT * FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
@Setup public void setUp() throws IOException { queryRunner = new LocalQueryRunner(testSessionBuilder() .setCatalog("memory") .setSchema("default") .build()); queryRunner.installPlugin(new GeoPlugin()); queryRunner.createCatalog("memory", new MemoryConnectorFactory(), ImmutableMap.of()); Path path = Paths.get(BenchmarkGeometryAggregations.class.getClassLoader().getResource("us-states.tsv").getPath()); String polygonValues = Files.lines(path) .map(line -> line.split("\t")) .map(parts -> format("('%s', '%s')", parts[0], parts[1])) .collect(Collectors.joining(",")); queryRunner.execute( format("CREATE TABLE memory.default.us_states AS SELECT ST_GeometryFromText(t.wkt) AS geom FROM (VALUES %s) as t (name, wkt)", polygonValues)); }
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; }