Search in sources :

Example 1 with CreateSchema

use of com.facebook.presto.sql.tree.CreateSchema in project presto by prestodb.

the class TestSqlParser method testCreateSchema.

@Test
public void testCreateSchema() {
    assertStatement("CREATE SCHEMA test", new CreateSchema(QualifiedName.of("test"), false, ImmutableMap.of()));
    assertStatement("CREATE SCHEMA IF NOT EXISTS test", new CreateSchema(QualifiedName.of("test"), true, ImmutableMap.of()));
    assertStatement("CREATE SCHEMA test WITH (a = 'apple', b = 123)", new CreateSchema(QualifiedName.of("test"), false, ImmutableMap.of("a", new StringLiteral("apple"), "b", new LongLiteral("123"))));
}
Also used : StringLiteral(com.facebook.presto.sql.tree.StringLiteral) LongLiteral(com.facebook.presto.sql.tree.LongLiteral) CreateSchema(com.facebook.presto.sql.tree.CreateSchema) Test(org.testng.annotations.Test)

Aggregations

CreateSchema (com.facebook.presto.sql.tree.CreateSchema)1 LongLiteral (com.facebook.presto.sql.tree.LongLiteral)1 StringLiteral (com.facebook.presto.sql.tree.StringLiteral)1 Test (org.testng.annotations.Test)1