Search in sources :

Example 21 with LocalQueryRunner

use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.

the class TestAddExchangesPlans method createQueryRunner.

private static LocalQueryRunner createQueryRunner() {
    Session session = testSessionBuilder().setCatalog("tpch").setSchema("tiny").build();
    FeaturesConfig featuresConfig = new FeaturesConfig().setSpillerSpillPaths("/tmp/test_spill_path");
    LocalQueryRunner queryRunner = new LocalQueryRunner(session, featuresConfig);
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpchConnectorFactory(io.prestosql.plugin.tpch.TpchConnectorFactory) FeaturesConfig(io.prestosql.sql.analyzer.FeaturesConfig) LocalQueryRunner(io.prestosql.testing.LocalQueryRunner) Session(io.prestosql.Session)

Example 22 with LocalQueryRunner

use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.

the class TestJoinNodeFlattener method setUp.

@BeforeClass
public void setUp() {
    queryRunner = new LocalQueryRunner(testSessionBuilder().build());
    logicalRowExpressions = new LogicalRowExpressions(new RowExpressionDeterminismEvaluator(queryRunner.getMetadata()), new FunctionResolution(queryRunner.getMetadata().getFunctionAndTypeManager()), queryRunner.getMetadata().getFunctionAndTypeManager());
}
Also used : RowExpressionDeterminismEvaluator(io.prestosql.sql.relational.RowExpressionDeterminismEvaluator) LogicalRowExpressions(io.prestosql.expressions.LogicalRowExpressions) FunctionResolution(io.prestosql.sql.relational.FunctionResolution) LocalQueryRunner(io.prestosql.testing.LocalQueryRunner) BeforeClass(org.testng.annotations.BeforeClass)

Example 23 with LocalQueryRunner

use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.

the class ArrayComparisonBenchmark method main.

public static void main(String... args) {
    LocalQueryRunner localQueryRunner = createLocalQueryRunner();
    new ArrayEqualsBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
    new ArrayLessThanBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
    new ArrayGreaterThanBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
    new ArrayNotEqualBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
    new ArrayLessThanOrEqualBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
    new ArrayGreaterThanOrEqualBenchmark(localQueryRunner).runBenchmark(new SimpleLineBenchmarkResultWriter(System.out));
}
Also used : LocalQueryRunner(io.prestosql.testing.LocalQueryRunner) BenchmarkQueryRunner.createLocalQueryRunner(io.prestosql.benchmark.BenchmarkQueryRunner.createLocalQueryRunner)

Example 24 with LocalQueryRunner

use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.

the class BenchmarkQueryRunner method createLocalQueryRunner.

public static LocalQueryRunner createLocalQueryRunner(Map<String, String> extraSessionProperties) {
    SessionBuilder sessionBuilder = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME);
    extraSessionProperties.forEach(sessionBuilder::setSystemProperty);
    Session session = sessionBuilder.build();
    LocalQueryRunner localQueryRunner = new LocalQueryRunner(session);
    // add tpch
    localQueryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return localQueryRunner;
}
Also used : TpchConnectorFactory(io.prestosql.plugin.tpch.TpchConnectorFactory) SessionBuilder(io.prestosql.Session.SessionBuilder) TestingSession.testSessionBuilder(io.prestosql.testing.TestingSession.testSessionBuilder) LocalQueryRunner(io.prestosql.testing.LocalQueryRunner) Session(io.prestosql.Session)

Example 25 with LocalQueryRunner

use of io.prestosql.testing.LocalQueryRunner in project hetu-core by openlookeng.

the class TestPruneCTENodes method createQueryRunner.

private static LocalQueryRunner createQueryRunner() {
    Session session = testSessionBuilder().setCatalog("tpch").setSchema("tiny").build();
    FeaturesConfig featuresConfig = new FeaturesConfig().setSpillerSpillPaths("/tmp/test_spill_path");
    LocalQueryRunner queryRunner = new LocalQueryRunner(session, featuresConfig);
    queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
    return queryRunner;
}
Also used : TpchConnectorFactory(io.prestosql.plugin.tpch.TpchConnectorFactory) FeaturesConfig(io.prestosql.sql.analyzer.FeaturesConfig) LocalQueryRunner(io.prestosql.testing.LocalQueryRunner) Session(io.prestosql.Session)

Aggregations

LocalQueryRunner (io.prestosql.testing.LocalQueryRunner)29 TpchConnectorFactory (io.prestosql.plugin.tpch.TpchConnectorFactory)20 Session (io.prestosql.Session)15 BeforeClass (org.testng.annotations.BeforeClass)9 File (java.io.File)4 ImmutableMap (com.google.common.collect.ImmutableMap)3 FeaturesConfig (io.prestosql.sql.analyzer.FeaturesConfig)3 TestingSession.testSessionBuilder (io.prestosql.testing.TestingSession.testSessionBuilder)3 Test (org.testng.annotations.Test)3 ImmutableList (com.google.common.collect.ImmutableList)2 HetuFileSystemClientPlugin (io.hetu.core.filesystem.HetuFileSystemClientPlugin)2 BenchmarkQueryRunner.createLocalQueryRunner (io.prestosql.benchmark.BenchmarkQueryRunner.createLocalQueryRunner)2 BenchmarkSuite (io.prestosql.benchmark.BenchmarkSuite)2 MockConnectorFactory (io.prestosql.connector.MockConnectorFactory)2 SessionPropertyManager (io.prestosql.metadata.SessionPropertyManager)2 HiveIdentity (io.prestosql.plugin.hive.authentication.HiveIdentity)2 HiveMetastore (io.prestosql.plugin.hive.metastore.HiveMetastore)2 FileHiveMetastore.createTestingFileHiveMetastore (io.prestosql.plugin.hive.metastore.file.FileHiveMetastore.createTestingFileHiveMetastore)2 MemoryConnectorFactory (io.prestosql.plugin.memory.MemoryConnectorFactory)2 TINY_SCHEMA_NAME (io.prestosql.plugin.tpch.TpchMetadata.TINY_SCHEMA_NAME)2