Search in sources :

Example 6 with InsertCube

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

the class TestSqlParser method testInsertOverwriteCube.

@Test
public void testInsertOverwriteCube() {
    assertStatement("INSERT OVERWRITE CUBE foo WHERE d1 BETWEEN 1012020 AND 31012020", new InsertCube(QualifiedName.of("foo"), Optional.of(new BetweenPredicate(new Identifier("d1"), new LongLiteral("1012020"), new LongLiteral("31012020"))), true));
    assertStatement("INSERT OVERWRITE CUBE c1.s1.foo WHERE d1 BETWEEN 1012020 AND 31012020", new InsertCube(QualifiedName.of("c1", "s1", "foo"), Optional.of(new BetweenPredicate(new Identifier("d1"), new LongLiteral("1012020"), new LongLiteral("31012020"))), true));
}
Also used : Identifier(io.prestosql.sql.tree.Identifier) QueryUtil.quotedIdentifier(io.prestosql.sql.QueryUtil.quotedIdentifier) BetweenPredicate(io.prestosql.sql.tree.BetweenPredicate) LongLiteral(io.prestosql.sql.tree.LongLiteral) InsertCube(io.prestosql.sql.tree.InsertCube) Test(org.testng.annotations.Test)

Aggregations

InsertCube (io.prestosql.sql.tree.InsertCube)6 ComparisonExpression (io.prestosql.sql.tree.ComparisonExpression)4 Expression (io.prestosql.sql.tree.Expression)3 Identifier (io.prestosql.sql.tree.Identifier)3 IfExpression (io.prestosql.sql.tree.IfExpression)3 QualifiedName (io.prestosql.sql.tree.QualifiedName)3 QuantifiedComparisonExpression (io.prestosql.sql.tree.QuantifiedComparisonExpression)3 ArithmeticBinaryExpression (io.prestosql.sql.tree.ArithmeticBinaryExpression)2 ArithmeticUnaryExpression (io.prestosql.sql.tree.ArithmeticUnaryExpression)2 BindExpression (io.prestosql.sql.tree.BindExpression)2 CoalesceExpression (io.prestosql.sql.tree.CoalesceExpression)2 DereferenceExpression (io.prestosql.sql.tree.DereferenceExpression)2 InListExpression (io.prestosql.sql.tree.InListExpression)2 LambdaExpression (io.prestosql.sql.tree.LambdaExpression)2 LogicalBinaryExpression (io.prestosql.sql.tree.LogicalBinaryExpression)2 NotExpression (io.prestosql.sql.tree.NotExpression)2 NullIfExpression (io.prestosql.sql.tree.NullIfExpression)2 SearchedCaseExpression (io.prestosql.sql.tree.SearchedCaseExpression)2 SimpleCaseExpression (io.prestosql.sql.tree.SimpleCaseExpression)2 SubqueryExpression (io.prestosql.sql.tree.SubqueryExpression)2