Search in sources :

Example 1 with MemoryManagerConfig

use of io.prestosql.memory.MemoryManagerConfig in project hetu-core by openlookeng.

the class TestAnalyzer method testTooManyGroupingElements.

@Test
public void testTooManyGroupingElements() {
    Session session = testSessionBuilder(new SessionPropertyManager(new SystemSessionProperties(new QueryManagerConfig(), new TaskManagerConfig(), new MemoryManagerConfig(), new FeaturesConfig().setMaxGroupingSets(2048), new HetuConfig(), new SnapshotConfig()))).build();
    analyze(session, "SELECT a, b, c, d, e, f, g, h, i, j, k, SUM(l)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l)\n" + "GROUP BY CUBE (a, b, c, d, e, f), CUBE (g, h, i, j, k)");
    assertFails(session, TOO_MANY_GROUPING_SETS, "line 3:10: GROUP BY has 4096 grouping sets but can contain at most 2048", "SELECT a, b, c, d, e, f, g, h, i, j, k, l, SUM(m)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l, m)\n" + "GROUP BY CUBE (a, b, c, d, e, f), CUBE (g, h, i, j, k, l)");
    assertFails(session, TOO_MANY_GROUPING_SETS, format("line 3:10: GROUP BY has more than %s grouping sets but can contain at most 2048", Integer.MAX_VALUE), "SELECT a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae, SUM(af)" + "FROM (VALUES (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, " + "17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32))\n" + "t (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae, af)\n" + "GROUP BY CUBE (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, " + "q, r, s, t, u, v, x, w, y, z, aa, ab, ac, ad, ae)");
}
Also used : SnapshotConfig(io.prestosql.snapshot.SnapshotConfig) SessionPropertyManager(io.prestosql.metadata.SessionPropertyManager) QueryManagerConfig(io.prestosql.execution.QueryManagerConfig) TaskManagerConfig(io.prestosql.execution.TaskManagerConfig) MemoryManagerConfig(io.prestosql.memory.MemoryManagerConfig) HetuConfig(io.prestosql.utils.HetuConfig) Session(io.prestosql.Session) SystemSessionProperties(io.prestosql.SystemSessionProperties) Test(org.testng.annotations.Test)

Aggregations

Session (io.prestosql.Session)1 SystemSessionProperties (io.prestosql.SystemSessionProperties)1 QueryManagerConfig (io.prestosql.execution.QueryManagerConfig)1 TaskManagerConfig (io.prestosql.execution.TaskManagerConfig)1 MemoryManagerConfig (io.prestosql.memory.MemoryManagerConfig)1 SessionPropertyManager (io.prestosql.metadata.SessionPropertyManager)1 SnapshotConfig (io.prestosql.snapshot.SnapshotConfig)1 HetuConfig (io.prestosql.utils.HetuConfig)1 Test (org.testng.annotations.Test)1