Search in sources :

Example 1 with ShowStats

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

the class AstBuilder method visitShowStatsForQuery.

@Override
public Node visitShowStatsForQuery(SqlBaseParser.ShowStatsForQueryContext context) {
    QuerySpecification specification = (QuerySpecification) visitQuerySpecification(context.querySpecification());
    Query query = new Query(Optional.empty(), specification, Optional.empty(), Optional.empty(), Optional.empty());
    return new ShowStats(Optional.of(getLocation(context)), new TableSubquery(query));
}
Also used : QuerySpecification(io.prestosql.sql.tree.QuerySpecification) Query(io.prestosql.sql.tree.Query) WithQuery(io.prestosql.sql.tree.WithQuery) ShowStats(io.prestosql.sql.tree.ShowStats) TableSubquery(io.prestosql.sql.tree.TableSubquery)

Example 2 with ShowStats

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

the class TestSqlParser method testShowStats.

@Test
public void testShowStats() {
    final String[] tableNames = { "t", "s.t", "c.s.t" };
    for (String fullName : tableNames) {
        QualifiedName qualifiedName = makeQualifiedName(fullName);
        assertStatement(format("SHOW STATS FOR %s", qualifiedName), new ShowStats(new Table(qualifiedName)));
    }
}
Also used : Table(io.prestosql.sql.tree.Table) CreateTable(io.prestosql.sql.tree.CreateTable) VacuumTable(io.prestosql.sql.tree.VacuumTable) DropTable(io.prestosql.sql.tree.DropTable) RenameTable(io.prestosql.sql.tree.RenameTable) ShowStats(io.prestosql.sql.tree.ShowStats) QualifiedName(io.prestosql.sql.tree.QualifiedName) Test(org.testng.annotations.Test)

Aggregations

ShowStats (io.prestosql.sql.tree.ShowStats)2 CreateTable (io.prestosql.sql.tree.CreateTable)1 DropTable (io.prestosql.sql.tree.DropTable)1 QualifiedName (io.prestosql.sql.tree.QualifiedName)1 Query (io.prestosql.sql.tree.Query)1 QuerySpecification (io.prestosql.sql.tree.QuerySpecification)1 RenameTable (io.prestosql.sql.tree.RenameTable)1 Table (io.prestosql.sql.tree.Table)1 TableSubquery (io.prestosql.sql.tree.TableSubquery)1 VacuumTable (io.prestosql.sql.tree.VacuumTable)1 WithQuery (io.prestosql.sql.tree.WithQuery)1 Test (org.testng.annotations.Test)1