Search in sources :

Example 1 with ExplainType

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

the class TestSqlParser method testExplain.

@Test
public void testExplain() {
    assertStatement("EXPLAIN SELECT * FROM t", new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, false, ImmutableList.of()));
    assertStatement("EXPLAIN (TYPE LOGICAL) SELECT * FROM t", new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, false, ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL))));
    assertStatement("EXPLAIN (TYPE LOGICAL, FORMAT TEXT) SELECT * FROM t", new Explain(simpleQuery(selectList(new AllColumns()), table(QualifiedName.of("t"))), false, false, ImmutableList.of(new ExplainType(ExplainType.Type.LOGICAL), new ExplainFormat(ExplainFormat.Type.TEXT))));
}
Also used : ExplainType(io.prestosql.sql.tree.ExplainType) ExplainFormat(io.prestosql.sql.tree.ExplainFormat) Explain(io.prestosql.sql.tree.Explain) AllColumns(io.prestosql.sql.tree.AllColumns) Test(org.testng.annotations.Test)

Aggregations

AllColumns (io.prestosql.sql.tree.AllColumns)1 Explain (io.prestosql.sql.tree.Explain)1 ExplainFormat (io.prestosql.sql.tree.ExplainFormat)1 ExplainType (io.prestosql.sql.tree.ExplainType)1 Test (org.testng.annotations.Test)1