use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestColumnMask method init.
@BeforeClass
public void init() {
LocalQueryRunner runner = new LocalQueryRunner(SESSION);
runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
ConnectorViewDefinition view = new ConnectorViewDefinition("SELECT nationkey, name FROM local.tiny.nation", Optional.empty(), Optional.empty(), ImmutableList.of(new ConnectorViewDefinition.ViewColumn("nationkey", BigintType.BIGINT.getTypeSignature()), new ConnectorViewDefinition.ViewColumn("name", VarcharType.createVarcharType(25).getTypeSignature())), Optional.of(VIEW_OWNER), false);
MockConnectorFactory mock = MockConnectorFactory.builder().withGetViews((s, prefix) -> ImmutableMap.<SchemaTableName, ConnectorViewDefinition>builder().put(new SchemaTableName("default", "nation_view"), view).build()).build();
runner.createCatalog(MOCK_CATALOG, mock, ImmutableMap.of());
assertions = new QueryAssertions(runner);
accessControl = assertions.getQueryRunner().getAccessControl();
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestQueryPlanDeterminism method createLocalQueryRunner.
private static LocalQueryRunner createLocalQueryRunner() {
Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).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;
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestQuerySpillLimits method createLocalQueryRunner.
private LocalQueryRunner createLocalQueryRunner(NodeSpillConfig nodeSpillConfig) {
LocalQueryRunner queryRunner = null;
try {
String canonicalPath = spillPath.getCanonicalPath();
queryRunner = new LocalQueryRunner(SESSION, new FeaturesConfig().setSpillerSpillPaths(canonicalPath).setSpillEnabled(true), nodeSpillConfig, false, true);
} catch (IOException e) {
throw new IllegalArgumentException(e);
}
queryRunner.createCatalog(SESSION.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
queryRunner.installPlugin(new HetuFileSystemClientPlugin());
return queryRunner;
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestTpchLocalStats method setUp.
@BeforeClass
public void setUp() {
Session defaultSession = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME).setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false").build();
LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession);
queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name()));
statisticsAssertion = new StatisticsAssertion(queryRunner);
}
use of io.prestosql.plugin.tpch.TpchConnectorFactory in project hetu-core by openlookeng.
the class TestIterativeOptimizer method setUp.
@BeforeClass
public void setUp() {
Session.SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("local").setSchema("tiny").setSystemProperty("task_concurrency", "1").setSystemProperty("iterative_optimizer_enabled", "true").setSystemProperty("iterative_optimizer_timeout", "1ms");
queryRunner = new LocalQueryRunner(sessionBuilder.build());
queryRunner.createCatalog(queryRunner.getDefaultSession().getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
}
Aggregations