Search in sources :

Example 1 with TestingRowExpressionTranslator

use of io.prestosql.sql.TestingRowExpressionTranslator in project hetu-core by openlookeng.

the class TestConnectorFilterStatsCalculatorService method setUp.

@BeforeClass
public void setUp() {
    session = testSessionBuilder().build();
    MetadataManager metadata = MetadataManager.createTestMetadataManager();
    FilterStatsCalculator statsCalculator = new FilterStatsCalculator(metadata, new ScalarStatsCalculator(metadata), new StatsNormalizer());
    statsCalculatorService = new ConnectorFilterStatsCalculatorService(statsCalculator);
    xStats = ColumnStatistics.builder().setDistinctValuesCount(Estimate.of(40)).setRange(new DoubleRange(-10, 10)).setNullsFraction(Estimate.of(0.25)).build();
    zeroTableStatistics = TableStatistics.builder().setRowCount(Estimate.zero()).build();
    unknownTableStatistics = TableStatistics.builder().setRowCount(Estimate.unknown()).build();
    originalTableStatistics = TableStatistics.builder().setRowCount(Estimate.of(100)).setColumnStatistics(xColumn, xStats).build();
    originalTableStatisticsWithoutTotalSize = TableStatistics.builder().setRowCount(Estimate.of(100)).setColumnStatistics(xColumn, xStats).build();
    standardTypes = TypeProvider.viewOf(ImmutableMap.<Symbol, Type>builder().put(new Symbol("x"), DOUBLE).build());
    translator = new TestingRowExpressionTranslator(MetadataManager.createTestMetadataManager());
}
Also used : DoubleRange(io.prestosql.spi.statistics.DoubleRange) Type(io.prestosql.spi.type.Type) MetadataManager(io.prestosql.metadata.MetadataManager) TestingRowExpressionTranslator(io.prestosql.sql.TestingRowExpressionTranslator) Symbol(io.prestosql.spi.plan.Symbol) BeforeClass(org.testng.annotations.BeforeClass)

Aggregations

MetadataManager (io.prestosql.metadata.MetadataManager)1 Symbol (io.prestosql.spi.plan.Symbol)1 DoubleRange (io.prestosql.spi.statistics.DoubleRange)1 Type (io.prestosql.spi.type.Type)1 TestingRowExpressionTranslator (io.prestosql.sql.TestingRowExpressionTranslator)1 BeforeClass (org.testng.annotations.BeforeClass)1