Search in sources :

Example 6 with LiteralEncoder

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

the class TestScalarStatsCalculator method testVarbinaryConstant.

@Test
public void testVarbinaryConstant() {
    LiteralEncoder literalEncoder = new LiteralEncoder(metadata);
    Expression expression = literalEncoder.toExpression(Slices.utf8Slice("ala ma kota"), VARBINARY);
    assertCalculate(expression).distinctValuesCount(1.0).lowValueUnknown().highValueUnknown().nullsFraction(0.0);
}
Also used : Expression(io.prestosql.sql.tree.Expression) LiteralEncoder(io.prestosql.sql.planner.LiteralEncoder) Test(org.testng.annotations.Test)

Aggregations

LiteralEncoder (io.prestosql.sql.planner.LiteralEncoder)6 Expression (io.prestosql.sql.tree.Expression)3 Metadata (io.prestosql.metadata.Metadata)2 Type (io.prestosql.spi.type.Type)2 TypeAnalyzer (io.prestosql.sql.planner.TypeAnalyzer)2 Rule (io.prestosql.sql.planner.iterative.Rule)2 Map (java.util.Map)2 ImmutableList.toImmutableList (com.google.common.collect.ImmutableList.toImmutableList)1 ImmutableMap.toImmutableMap (com.google.common.collect.ImmutableMap.toImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 Session (io.prestosql.Session)1 Capture (io.prestosql.matching.Capture)1 Capture.newCapture (io.prestosql.matching.Capture.newCapture)1 Captures (io.prestosql.matching.Captures)1 Pattern (io.prestosql.matching.Pattern)1 Block (io.prestosql.spi.block.Block)1 ColumnHandle (io.prestosql.spi.connector.ColumnHandle)1 Constraint (io.prestosql.spi.connector.Constraint)1 ProjectionApplicationResult (io.prestosql.spi.connector.ProjectionApplicationResult)1 ConnectorExpression (io.prestosql.spi.expression.ConnectorExpression)1