use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestCostCalculator method setUp.
@BeforeClass
public void setUp() {
TaskCountEstimator taskCountEstimator = new TaskCountEstimator(() -> NUMBER_OF_NODES);
costCalculatorUsingExchanges = new CostCalculatorUsingExchanges(taskCountEstimator);
costCalculatorWithEstimatedExchanges = new CostCalculatorWithEstimatedExchanges(costCalculatorUsingExchanges, taskCountEstimator);
session = testSessionBuilder().setCatalog("tpch").build();
localQueryRunner = LocalQueryRunner.create(session);
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(), ImmutableMap.of());
planFragmenter = new PlanFragmenter(localQueryRunner.getMetadata(), localQueryRunner.getFunctionManager(), localQueryRunner.getNodePartitioningManager(), new QueryManagerConfig());
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class HiveBenchmarkQueryRunner method createLocalQueryRunner.
public static LocalQueryRunner createLocalQueryRunner(File tempDir) {
Session session = testSessionBuilder().setCatalog("hive").setSchema("tpch").build();
LocalQueryRunner localQueryRunner = LocalQueryRunner.create(session);
// add tpch
localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
// add hive
File hiveDir = new File(tempDir, "hive_data");
HiveMetastore metastore = createTestingFileHiveMetastore(hiveDir);
metastore.createDatabase(Database.builder().setDatabaseName("tpch").setOwnerName(Optional.of("public")).setOwnerType(Optional.of(PrincipalType.ROLE)).build());
Map<String, String> hiveCatalogConfig = ImmutableMap.<String, String>builder().put("hive.max-split-size", "10GB").buildOrThrow();
localQueryRunner.createCatalog("hive", new TestingHiveConnectorFactory(metastore), 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.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestFilterInaccessibleColumns method init.
@BeforeClass
public void init() {
LocalQueryRunner runner = LocalQueryRunner.builder(SESSION).withFeaturesConfig(new FeaturesConfig().setHideInaccessibleColumns(true)).build();
runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
assertions = new QueryAssertions(runner);
accessControl = assertions.getQueryRunner().getAccessControl();
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestNestedLogicalBinaryExpression method init.
@BeforeAll
public void init() {
Session session = testSessionBuilder().setCatalog(CATALOG).setSchema(TINY_SCHEMA_NAME).build();
LocalQueryRunner runner = LocalQueryRunner.builder(session).build();
runner.createCatalog(CATALOG, new TpchConnectorFactory(1), ImmutableMap.of());
assertions = new QueryAssertions(runner);
}
use of io.trino.plugin.tpch.TpchConnectorFactory in project trino by trinodb.
the class TestMLQueries method createQueryRunner.
@Override
protected QueryRunner createQueryRunner() {
Session defaultSession = testSessionBuilder().setCatalog("local").setSchema(TINY_SCHEMA_NAME).build();
LocalQueryRunner localQueryRunner = LocalQueryRunner.create(defaultSession);
// add the tpch catalog
// local queries run directly against the generator
localQueryRunner.createCatalog(defaultSession.getCatalog().get(), new TpchConnectorFactory(1), ImmutableMap.of());
localQueryRunner.installPlugin(new MLPlugin());
return localQueryRunner;
}
Aggregations