Search in sources :

Example 1 with Cache

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

the class TestSqlParser method testCacheTable.

@Test
public void testCacheTable() {
    assertStatement("CACHE TABLE foo WHERE a = b", new Cache(QualifiedName.of("foo"), Optional.of(new ComparisonExpression(ComparisonExpression.Operator.EQUAL, new Identifier("a"), new Identifier("b")))));
    assertStatement("CACHE TABLE foo WHERE a = b", new Cache(new NodeLocation(0, 0), QualifiedName.of("foo"), Optional.of(new ComparisonExpression(ComparisonExpression.Operator.EQUAL, new Identifier("a"), new Identifier("b")))));
}
Also used : ComparisonExpression(io.prestosql.sql.tree.ComparisonExpression) QuantifiedComparisonExpression(io.prestosql.sql.tree.QuantifiedComparisonExpression) Identifier(io.prestosql.sql.tree.Identifier) QueryUtil.quotedIdentifier(io.prestosql.sql.QueryUtil.quotedIdentifier) NodeLocation(io.prestosql.sql.tree.NodeLocation) ShowCache(io.prestosql.sql.tree.ShowCache) Cache(io.prestosql.sql.tree.Cache) DropCache(io.prestosql.sql.tree.DropCache) RefreshMetadataCache(io.prestosql.sql.tree.RefreshMetadataCache) Test(org.testng.annotations.Test)

Aggregations

QueryUtil.quotedIdentifier (io.prestosql.sql.QueryUtil.quotedIdentifier)1 Cache (io.prestosql.sql.tree.Cache)1 ComparisonExpression (io.prestosql.sql.tree.ComparisonExpression)1 DropCache (io.prestosql.sql.tree.DropCache)1 Identifier (io.prestosql.sql.tree.Identifier)1 NodeLocation (io.prestosql.sql.tree.NodeLocation)1 QuantifiedComparisonExpression (io.prestosql.sql.tree.QuantifiedComparisonExpression)1 RefreshMetadataCache (io.prestosql.sql.tree.RefreshMetadataCache)1 ShowCache (io.prestosql.sql.tree.ShowCache)1 Test (org.testng.annotations.Test)1