Search in sources :

Example 6 with CubeStatement

use of io.hetu.core.spi.cube.CubeStatement in project hetu-core by openlookeng.

the class TestStarTreeMetadata method testMetadataMatchesCubeStatementWithoutAvg.

@Test
public void testMetadataMatchesCubeStatementWithoutAvg() {
    CubeStatement statement = CubeStatement.newBuilder().select("returnflag", "linestatus").aggregate(sum("quantity", false)).from("tpch.tiny.lineitem2").groupByAddStringList("returnflag", "linestatus").build();
    assertTrue(metadataWithoutAvg.matches(statement), "failed to match a valid cube statement");
}
Also used : CubeStatement(io.hetu.core.spi.cube.CubeStatement) Test(org.testng.annotations.Test)

Example 7 with CubeStatement

use of io.hetu.core.spi.cube.CubeStatement in project hetu-core by openlookeng.

the class TestStarTreeMetadata method testMetadataMatchesCubeStatementWithAvg.

@Test
public void testMetadataMatchesCubeStatementWithAvg() {
    CubeStatement statement = CubeStatement.newBuilder().select("returnflag", "linestatus").aggregate(avg("quantity", false)).aggregate(avg("discount", false)).from("tpch.tiny.lineitem3").groupByAddStringList("returnflag", "linestatus").build();
    assertTrue(metadataWithAvg.matches(statement), "failed to match a valid cube statement");
}
Also used : CubeStatement(io.hetu.core.spi.cube.CubeStatement) Test(org.testng.annotations.Test)

Example 8 with CubeStatement

use of io.hetu.core.spi.cube.CubeStatement in project hetu-core by openlookeng.

the class TestStarTreeMetadata method testMetadataMatchesCubeStatementWithAvgWithoutSumCount.

@Test
public void testMetadataMatchesCubeStatementWithAvgWithoutSumCount() {
    CubeStatement statement = CubeStatement.newBuilder().select("returnflag", "linestatus").aggregate(avg("quantity", false)).from("tpch.tiny.lineitem4").groupByAddStringList("returnflag", "linestatus").build();
    assertFalse(metadataWithAvgWithoutSumCount.matches(statement), "failed to match a valid cube statement");
}
Also used : CubeStatement(io.hetu.core.spi.cube.CubeStatement) Test(org.testng.annotations.Test)

Aggregations

CubeStatement (io.hetu.core.spi.cube.CubeStatement)8 Test (org.testng.annotations.Test)6 Symbol (io.prestosql.spi.plan.Symbol)2 Expression (io.prestosql.sql.tree.Expression)2 List (java.util.List)2 Map (java.util.Map)2 Logger (io.airlift.log.Logger)1 CubeFilter (io.hetu.core.spi.cube.CubeFilter)1 CubeMetadata (io.hetu.core.spi.cube.CubeMetadata)1 AggregationSignature (io.hetu.core.spi.cube.aggregator.AggregationSignature)1 CubeMetaStore (io.hetu.core.spi.cube.io.CubeMetaStore)1 Session (io.prestosql.Session)1 SystemSessionProperties (io.prestosql.SystemSessionProperties)1 SystemSessionProperties.isEnableStarTreeIndex (io.prestosql.SystemSessionProperties.isEnableStarTreeIndex)1 CubeManager (io.prestosql.cube.CubeManager)1 STAR_TREE (io.prestosql.cube.CubeManager.STAR_TREE)1 CubeStatementGenerator (io.prestosql.cube.CubeStatementGenerator)1 WarningCollector (io.prestosql.execution.warnings.WarningCollector)1 Capture (io.prestosql.matching.Capture)1 Capture.newCapture (io.prestosql.matching.Capture.newCapture)1