diff --git a/core/trino-main/pom.xml b/core/trino-main/pom.xml index 30c59ee7b1a3..af2f2e75d995 100644 --- a/core/trino-main/pom.xml +++ b/core/trino-main/pom.xml @@ -202,7 +202,7 @@ io.arenadata trino-catalog-manager - 1.0-SNAPSHOT + ${arenadata-catalog-manager.version} diff --git a/core/trino-main/src/test/java/io/trino/execution/TestArenadataCatalogManager.java b/core/trino-main/src/test/java/io/trino/execution/TestArenadataCatalogManager.java index f0e693c9b2f5..9dded336f27d 100644 --- a/core/trino-main/src/test/java/io/trino/execution/TestArenadataCatalogManager.java +++ b/core/trino-main/src/test/java/io/trino/execution/TestArenadataCatalogManager.java @@ -30,6 +30,7 @@ import io.trino.sql.tree.CreateCatalog; import io.trino.sql.tree.DropCatalog; import io.trino.sql.tree.Identifier; +import io.trino.sql.tree.NodeLocation; import io.trino.sql.tree.Property; import io.trino.sql.tree.Statement; import io.trino.sql.tree.StringLiteral; @@ -117,9 +118,9 @@ public void tearDown() @AfterEach public void afterDown() { - DropCatalog statement = new DropCatalog(new Identifier(TEST_CATALOG), true, false); - DropCatalog statement2 = new DropCatalog(new Identifier(TEST_CATALOG2), true, false); - DropCatalog statement3 = new DropCatalog(new Identifier(TEST_CATALOG3), true, false); + DropCatalog statement = new DropCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), true, false); + DropCatalog statement2 = new DropCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG2), true, false); + DropCatalog statement3 = new DropCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG3), true, false); getFutureValue(dropTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); getFutureValue(dropTask.execute(statement2, createNewQuery(), emptyList(), WarningCollector.NOOP)); getFutureValue(dropTask.execute(statement3, createNewQuery(), emptyList(), WarningCollector.NOOP)); @@ -128,7 +129,7 @@ public void afterDown() @Test public void testDuplicatedCreateCatalog() { - CreateCatalog statement = new CreateCatalog(new Identifier(TEST_CATALOG), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); + CreateCatalog statement = new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); getFutureValue(createTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isTrue(); assertThat(queryRunner.getPlannerContext().getMetadata().listCatalogs(createNewQuery().getSession()).stream() @@ -142,7 +143,7 @@ public void testDuplicatedCreateCatalog() @Test public void testDuplicatedCreateCatalogIfNotExists() { - CreateCatalog statement = new CreateCatalog(new Identifier(TEST_CATALOG), true, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); + CreateCatalog statement = new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), true, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); getFutureValue(createTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isTrue(); getFutureValue(createTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); @@ -157,7 +158,7 @@ public void testDropNotExistedCatalog() { queryRunner.createCatalog(TEST_CATALOG, "tpch", ImmutableMap.of()); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isTrue(); - DropCatalog statement = new DropCatalog(new Identifier(TEST_CATALOG), false, false); + DropCatalog statement = new DropCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), false, false); getFutureValue(dropTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isFalse(); assertThatExceptionOfType(TrinoException.class) @@ -173,7 +174,7 @@ public void testDropCatalogIfNotExists() { queryRunner.createCatalog(TEST_CATALOG, "tpch", ImmutableMap.of()); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isTrue(); - DropCatalog statement = new DropCatalog(new Identifier(TEST_CATALOG), true, false); + DropCatalog statement = new DropCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), true, false); getFutureValue(dropTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); assertThat(queryRunner.getPlannerContext().getMetadata().catalogExists(createNewQuery().getSession(), TEST_CATALOG)).isFalse(); getFutureValue(dropTask.execute(statement, createNewQuery(), emptyList(), WarningCollector.NOOP)); @@ -186,9 +187,9 @@ public void testDropCatalogIfNotExists() @Test public void testCreateCatalogs() { - CreateCatalog statement1 = new CreateCatalog(new Identifier(TEST_CATALOG), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); - CreateCatalog statement2 = new CreateCatalog(new Identifier(TEST_CATALOG2), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); - CreateCatalog statement3 = new CreateCatalog(new Identifier(TEST_CATALOG3), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); + CreateCatalog statement1 = new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); + CreateCatalog statement2 = new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG2), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); + CreateCatalog statement3 = new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG3), false, new Identifier("tpch"), TPCH_PROPERTIES, Optional.empty(), Optional.empty()); getFutureValue(createTask.execute(statement1, createNewQuery(), emptyList(), WarningCollector.NOOP)); getFutureValue(createTask.execute(statement2, createNewQuery(), emptyList(), WarningCollector.NOOP)); getFutureValue(createTask.execute(statement3, createNewQuery(), emptyList(), WarningCollector.NOOP)); @@ -208,7 +209,7 @@ public void failCreateCatalog() { assertThatExceptionOfType(IllegalArgumentException.class) .isThrownBy(() -> getFutureValue(createTask.execute( - new CreateCatalog( + new CreateCatalog(new NodeLocation(1, 1), new Identifier(TEST_CATALOG), true, new Identifier("fail"), diff --git a/pom.xml b/pom.xml index e6fcbd641352..076c61cfa344 100644 --- a/pom.xml +++ b/pom.xml @@ -223,6 +223,7 @@ Since 1.1.0, the default behaviour for such conflicts changed from overwriting the artifact to failing the build. --> GA + 1.0-SNAPSHOT @@ -2752,6 +2753,30 @@ org.liquibase liquibase-core + + org.postgresql + postgresql + + + commons-io + commons-io + + + org.apache.commons + commons-lang3 + + + org.checkerframework + checker-qual + + + com.opencsv + opencsv + + + org.yaml + snakeyaml + io.arenadata trino-catalog-manager diff --git a/testing/trino-tests/pom.xml b/testing/trino-tests/pom.xml index 94d96a730298..68cd015b543b 100644 --- a/testing/trino-tests/pom.xml +++ b/testing/trino-tests/pom.xml @@ -139,6 +139,13 @@ test + + io.arenadata + trino-catalog-manager + ${arenadata-catalog-manager.version} + test + + io.opentelemetry opentelemetry-sdk-trace @@ -205,6 +212,12 @@ io.trino trino-main test + + + io.arenadata + trino-catalog-manager + +