|
44 | 44 | import org.junit.jupiter.api.io.TempDir;
|
45 | 45 |
|
46 | 46 | import java.lang.reflect.Field;
|
47 |
| -import java.nio.file.Path; |
48 |
| -import java.nio.file.Paths; |
49 | 47 | import java.util.ArrayList;
|
50 | 48 | import java.util.Arrays;
|
51 | 49 | import java.util.Collections;
|
|
61 | 59 | import static org.apache.paimon.hive.HiveCatalog.TABLE_TYPE_PROP;
|
62 | 60 | import static org.assertj.core.api.Assertions.assertThat;
|
63 | 61 | import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
64 |
| -import static org.junit.Assert.assertThrows; |
65 | 62 | import static org.junit.jupiter.api.Assertions.assertEquals;
|
66 | 63 | import static org.junit.jupiter.api.Assertions.fail;
|
67 | 64 |
|
@@ -410,37 +407,6 @@ public void testListTables() throws Exception {
|
410 | 407 | catalog.dropDatabase(databaseName, true, true);
|
411 | 408 | }
|
412 | 409 |
|
413 |
| - @Test |
414 |
| - public void testDropTable() throws Exception { |
415 |
| - String databaseName = "drop_table_test_db"; |
416 |
| - String tableName = "drop_table_test_table"; |
417 |
| - catalog.dropDatabase(databaseName, true, true); |
418 |
| - catalog.createDatabase(databaseName, true); |
419 |
| - Identifier identifier = Identifier.create(databaseName, tableName); |
420 |
| - |
421 |
| - // test ignore if exists |
422 |
| - catalog.createTable( |
423 |
| - identifier, Schema.newBuilder().column("col", DataTypes.INT()).build(), true); |
424 |
| - Path path = Paths.get(catalog.warehouse(), databaseName.concat(".db"), tableName); |
425 |
| - catalog.fileIO().delete(new org.apache.paimon.fs.Path(path.toString()), true); |
426 |
| - List<String> tables = catalog.listTables(databaseName); |
427 |
| - assertEquals(1, tables.size()); |
428 |
| - catalog.dropTable(identifier, true); |
429 |
| - List<String> newTables = catalog.listTables(databaseName); |
430 |
| - assertEquals(0, newTables.size()); |
431 |
| - |
432 |
| - // test not ignore if exists |
433 |
| - catalog.createTable( |
434 |
| - identifier, Schema.newBuilder().column("col", DataTypes.INT()).build(), true); |
435 |
| - catalog.fileIO().delete(new org.apache.paimon.fs.Path(path.toString()), true); |
436 |
| - tables = catalog.listTables(databaseName); |
437 |
| - assertEquals(1, tables.size()); |
438 |
| - assertThrows( |
439 |
| - Catalog.TableNotExistException.class, () -> catalog.dropTable(identifier, false)); |
440 |
| - |
441 |
| - catalog.dropDatabase(databaseName, true, true); |
442 |
| - } |
443 |
| - |
444 | 410 | @Override
|
445 | 411 | protected boolean supportsView() {
|
446 | 412 | return true;
|
|
0 commit comments