Search in sources :

Example 1 with NodeLocation

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

the class TestSqlParser method testShowCache.

@Test
public void testShowCache() {
    assertStatement("SHOW CACHE", new ShowCache(Optional.empty(), Optional.empty()));
    assertStatement("SHOW CACHE a", new ShowCache(new NodeLocation(0, 0), QualifiedName.of("a")));
}
Also used : NodeLocation(io.prestosql.sql.tree.NodeLocation) ShowCache(io.prestosql.sql.tree.ShowCache) Test(org.testng.annotations.Test)

Example 2 with NodeLocation

use of io.prestosql.sql.tree.NodeLocation 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

NodeLocation (io.prestosql.sql.tree.NodeLocation)2 ShowCache (io.prestosql.sql.tree.ShowCache)2 Test (org.testng.annotations.Test)2 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 QuantifiedComparisonExpression (io.prestosql.sql.tree.QuantifiedComparisonExpression)1 RefreshMetadataCache (io.prestosql.sql.tree.RefreshMetadataCache)1