Search in sources :

Example 1 with RenameColumn

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

the class TestSqlParser method testRenameColumn.

@Test
public void testRenameColumn() {
    assertStatement("ALTER TABLE foo.t RENAME COLUMN a TO b", new RenameColumn(QualifiedName.of("foo", "t"), identifier("a"), identifier("b"), false, false));
    assertStatement("ALTER TABLE IF EXISTS foo.t RENAME COLUMN a TO b", new RenameColumn(QualifiedName.of("foo", "t"), identifier("a"), identifier("b"), true, false));
    assertStatement("ALTER TABLE foo.t RENAME COLUMN IF EXISTS a TO b", new RenameColumn(QualifiedName.of("foo", "t"), identifier("a"), identifier("b"), false, true));
    assertStatement("ALTER TABLE IF EXISTS foo.t RENAME COLUMN IF EXISTS a TO b", new RenameColumn(QualifiedName.of("foo", "t"), identifier("a"), identifier("b"), true, true));
}
Also used : RenameColumn(com.facebook.presto.sql.tree.RenameColumn) Test(org.testng.annotations.Test)

Aggregations

RenameColumn (com.facebook.presto.sql.tree.RenameColumn)1 Test (org.testng.annotations.Test)1