Search in sources :

Example 1 with StatisticsAssertion

use of com.facebook.presto.tests.statistics.StatisticsAssertion in project presto by prestodb.

the class TestTpchDistributedStats method setup.

@BeforeClass
public void setup() throws Exception {
    DistributedQueryRunner runner = TpchQueryRunnerBuilder.builder().amendSession(builder -> builder.setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false")).amendSession(builder -> builder.setSystemProperty(PRINT_STATS_FOR_NON_JOIN_QUERY, "true")).buildWithoutCatalogs();
    runner.createCatalog("tpch", "tpch", ImmutableMap.of(TPCH_COLUMN_NAMING_PROPERTY, ColumnNaming.STANDARD.name()));
    statisticsAssertion = new StatisticsAssertion(runner);
}
Also used : AfterClass(org.testng.annotations.AfterClass) ColumnNaming(com.facebook.presto.tpch.ColumnNaming) MetricComparisonStrategies.noError(com.facebook.presto.tests.statistics.MetricComparisonStrategies.noError) OUTPUT_ROW_COUNT(com.facebook.presto.tests.statistics.Metrics.OUTPUT_ROW_COUNT) ImmutableMap(com.google.common.collect.ImmutableMap) BeforeClass(org.testng.annotations.BeforeClass) MetricComparisonStrategies.absoluteError(com.facebook.presto.tests.statistics.MetricComparisonStrategies.absoluteError) MetricComparisonStrategies.relativeError(com.facebook.presto.tests.statistics.MetricComparisonStrategies.relativeError) Test(org.testng.annotations.Test) PRINT_STATS_FOR_NON_JOIN_QUERY(com.facebook.presto.SystemSessionProperties.PRINT_STATS_FOR_NON_JOIN_QUERY) MetricComparisonStrategies.defaultTolerance(com.facebook.presto.tests.statistics.MetricComparisonStrategies.defaultTolerance) TPCH_COLUMN_NAMING_PROPERTY(com.facebook.presto.tpch.TpchConnectorFactory.TPCH_COLUMN_NAMING_PROPERTY) TpchTable(io.airlift.tpch.TpchTable) Metrics.distinctValuesCount(com.facebook.presto.tests.statistics.Metrics.distinctValuesCount) PREFER_PARTIAL_AGGREGATION(com.facebook.presto.SystemSessionProperties.PREFER_PARTIAL_AGGREGATION) StatisticsAssertion(com.facebook.presto.tests.statistics.StatisticsAssertion) TpchQueryRunnerBuilder(com.facebook.presto.tests.tpch.TpchQueryRunnerBuilder) StatisticsAssertion(com.facebook.presto.tests.statistics.StatisticsAssertion) BeforeClass(org.testng.annotations.BeforeClass)

Example 2 with StatisticsAssertion

use of com.facebook.presto.tests.statistics.StatisticsAssertion in project presto by prestodb.

the class TestTpcdsLocalStats method setUp.

@BeforeClass
public void setUp() {
    Session defaultSession = testSessionBuilder().setCatalog("tpcds").setSchema("sf1").setSystemProperty(PRINT_STATS_FOR_NON_JOIN_QUERY, "true").build();
    LocalQueryRunner queryRunner = new LocalQueryRunner(defaultSession);
    queryRunner.createCatalog("tpcds", new TpcdsConnectorFactory(), emptyMap());
    statisticsAssertion = new StatisticsAssertion(queryRunner);
}
Also used : TpcdsConnectorFactory(com.facebook.presto.tpcds.TpcdsConnectorFactory) StatisticsAssertion(com.facebook.presto.tests.statistics.StatisticsAssertion) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session) BeforeClass(org.testng.annotations.BeforeClass)

Example 3 with StatisticsAssertion

use of com.facebook.presto.tests.statistics.StatisticsAssertion in project presto by prestodb.

the class TestTpchLocalStats method setUp.

@BeforeClass
public void setUp() {
    Session defaultSession = testSessionBuilder().setCatalog("tpch").setSchema(TINY_SCHEMA_NAME).setSystemProperty(PREFER_PARTIAL_AGGREGATION, "false").setSystemProperty(PRINT_STATS_FOR_NON_JOIN_QUERY, "true").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);
}
Also used : TpchConnectorFactory(com.facebook.presto.tpch.TpchConnectorFactory) StatisticsAssertion(com.facebook.presto.tests.statistics.StatisticsAssertion) LocalQueryRunner(com.facebook.presto.testing.LocalQueryRunner) Session(com.facebook.presto.Session) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

StatisticsAssertion (com.facebook.presto.tests.statistics.StatisticsAssertion)3 BeforeClass (org.testng.annotations.BeforeClass)3 Session (com.facebook.presto.Session)2 LocalQueryRunner (com.facebook.presto.testing.LocalQueryRunner)2 PREFER_PARTIAL_AGGREGATION (com.facebook.presto.SystemSessionProperties.PREFER_PARTIAL_AGGREGATION)1 PRINT_STATS_FOR_NON_JOIN_QUERY (com.facebook.presto.SystemSessionProperties.PRINT_STATS_FOR_NON_JOIN_QUERY)1 MetricComparisonStrategies.absoluteError (com.facebook.presto.tests.statistics.MetricComparisonStrategies.absoluteError)1 MetricComparisonStrategies.defaultTolerance (com.facebook.presto.tests.statistics.MetricComparisonStrategies.defaultTolerance)1 MetricComparisonStrategies.noError (com.facebook.presto.tests.statistics.MetricComparisonStrategies.noError)1 MetricComparisonStrategies.relativeError (com.facebook.presto.tests.statistics.MetricComparisonStrategies.relativeError)1 OUTPUT_ROW_COUNT (com.facebook.presto.tests.statistics.Metrics.OUTPUT_ROW_COUNT)1 Metrics.distinctValuesCount (com.facebook.presto.tests.statistics.Metrics.distinctValuesCount)1 TpchQueryRunnerBuilder (com.facebook.presto.tests.tpch.TpchQueryRunnerBuilder)1 TpcdsConnectorFactory (com.facebook.presto.tpcds.TpcdsConnectorFactory)1 ColumnNaming (com.facebook.presto.tpch.ColumnNaming)1 TpchConnectorFactory (com.facebook.presto.tpch.TpchConnectorFactory)1 TPCH_COLUMN_NAMING_PROPERTY (com.facebook.presto.tpch.TpchConnectorFactory.TPCH_COLUMN_NAMING_PROPERTY)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 TpchTable (io.airlift.tpch.TpchTable)1 AfterClass (org.testng.annotations.AfterClass)1