Search in sources :

Example 1 with DropTablePlan

use of io.crate.planner.node.ddl.DropTablePlan in project crate by crate.

the class DropTablePlannerTest method testDropPartitionedTable.

@Test
public void testDropPartitionedTable() throws Exception {
    DropTablePlan plan = e.plan("drop table parted");
    assertThat(plan.tableInfo().ident().name(), is("parted"));
}
Also used : DropTablePlan(io.crate.planner.node.ddl.DropTablePlan) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Example 2 with DropTablePlan

use of io.crate.planner.node.ddl.DropTablePlan in project crate by crate.

the class DropTablePlannerTest method testDropTableIfExistsNonExistentTableCreatesPlanWithoutTableInfo.

@Test
public void testDropTableIfExistsNonExistentTableCreatesPlanWithoutTableInfo() throws Exception {
    DropTablePlan plan = e.plan("drop table if exists groups");
    assertThat(plan.tableInfo(), Matchers.nullValue());
    assertThat(plan.dropTable().maybeCorrupt(), is(false));
}
Also used : DropTablePlan(io.crate.planner.node.ddl.DropTablePlan) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Example 3 with DropTablePlan

use of io.crate.planner.node.ddl.DropTablePlan in project crate by crate.

the class DropTablePlannerTest method testDropTableIfExists.

@Test
public void testDropTableIfExists() throws Exception {
    DropTablePlan plan = e.plan("drop table if exists users");
    assertThat(plan.tableInfo().ident().name(), is("users"));
}
Also used : DropTablePlan(io.crate.planner.node.ddl.DropTablePlan) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Example 4 with DropTablePlan

use of io.crate.planner.node.ddl.DropTablePlan in project crate by crate.

the class DropTablePlannerTest method testDropNonExistentBlobTableCreatesPlanWithoutTableInfo.

@Test
public void testDropNonExistentBlobTableCreatesPlanWithoutTableInfo() throws Exception {
    DropTablePlan plan = e.plan("drop blob table if exists unknown");
    assertThat(plan.tableInfo(), Matchers.nullValue());
    assertThat(plan.dropTable().maybeCorrupt(), is(false));
}
Also used : DropTablePlan(io.crate.planner.node.ddl.DropTablePlan) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Example 5 with DropTablePlan

use of io.crate.planner.node.ddl.DropTablePlan in project crate by crate.

the class DropTablePlannerTest method testDropTableIfExistsWithUnknownSchema.

@Test
public void testDropTableIfExistsWithUnknownSchema() throws Exception {
    DropTablePlan plan = e.plan("drop table if exists unknown_schema.unknwon_table");
    assertThat(plan.tableInfo(), Matchers.nullValue());
    assertThat(plan.dropTable().maybeCorrupt(), is(false));
}
Also used : DropTablePlan(io.crate.planner.node.ddl.DropTablePlan) Test(org.junit.Test) CrateDummyClusterServiceUnitTest(io.crate.test.integration.CrateDummyClusterServiceUnitTest)

Aggregations

DropTablePlan (io.crate.planner.node.ddl.DropTablePlan)6 CrateDummyClusterServiceUnitTest (io.crate.test.integration.CrateDummyClusterServiceUnitTest)6 Test (org.junit.Test)6