From 8d700dab913f895b1bd23fb786e6399a159b60fd Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Thu, 17 Oct 2024 23:05:58 -0400 Subject: [PATCH 01/26] iceberg glue catalog dependencies added --- extensions-contrib/druid-iceberg-extensions/pom.xml | 10 ++++++++++ .../apache/druid/iceberg/input/GlueIcebergCatalog.java | 2 ++ 2 files changed, 12 insertions(+) create mode 100644 extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 8d40e974e156..029af8f46bfb 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -271,6 +271,16 @@ iceberg-hive-metastore ${iceberg.core.version} + + org.apache.iceberg + iceberg-aws-bundle + ${iceberg.core.version} + + + org.apache.iceberg + iceberg-aws + ${iceberg.core.version} + org.apache.hive diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java new file mode 100644 index 000000000000..7828e2ded487 --- /dev/null +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -0,0 +1,2 @@ +package org.apache.druid.iceberg.input;public class GlueIcebergCatalog { +} From c84ce7b1af7e7623ca15ebe074a5982b8af37c28 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Thu, 17 Oct 2024 23:06:30 -0400 Subject: [PATCH 02/26] GlueIcebergCatalog added in druid module --- .../apache/druid/iceberg/common/IcebergDruidModule.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java index 418b63850b81..bbbbe17df0b8 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java @@ -25,10 +25,7 @@ import com.google.inject.Binder; import org.apache.druid.error.DruidException; import org.apache.druid.iceberg.guice.HiveConf; -import org.apache.druid.iceberg.input.HiveIcebergCatalog; -import org.apache.druid.iceberg.input.IcebergInputSource; -import org.apache.druid.iceberg.input.LocalCatalog; -import org.apache.druid.iceberg.input.RestIcebergCatalog; +import org.apache.druid.iceberg.input.*; import org.apache.druid.initialization.DruidModule; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; @@ -47,8 +44,8 @@ public List getJacksonModules() new NamedType(HiveIcebergCatalog.class, HiveIcebergCatalog.TYPE_KEY), new NamedType(LocalCatalog.class, LocalCatalog.TYPE_KEY), new NamedType(RestIcebergCatalog.class, RestIcebergCatalog.TYPE_KEY), - new NamedType(IcebergInputSource.class, IcebergInputSource.TYPE_KEY) - + new NamedType(IcebergInputSource.class, IcebergInputSource.TYPE_KEY), + new NamedType(GlueIcebergCatalog.class, GlueIcebergCatalog.TYPE_KEY) ) ); } From c66a39f6cb87cfffad0c27e053f37bfa317509b1 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Thu, 17 Oct 2024 23:07:13 -0400 Subject: [PATCH 03/26] default version of iceberg glue catalog implementation - basics --- .../iceberg/input/GlueIcebergCatalog.java | 70 ++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 7828e2ded487..17d993c2bc7f 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -1,2 +1,70 @@ -package org.apache.druid.iceberg.input;public class GlueIcebergCatalog { +package org.apache.druid.iceberg.input; + +import com.fasterxml.jackson.annotation.JacksonInject; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.google.common.base.Preconditions; +import org.apache.druid.guice.annotations.Json; +import org.apache.druid.java.util.common.logger.Logger; +import org.apache.druid.utils.DynamicConfigProviderUtils; +import org.apache.iceberg.CatalogProperties; +import org.apache.iceberg.catalog.Catalog; +import org.apache.iceberg.aws.glue.GlueCatalog; +import javax.annotation.Nullable; +import java.util.Map; + +public class GlueIcebergCatalog extends IcebergCatalog { + private static final String CATALOG_NAME = "glue"; + private Catalog catalog; + + public static final String TYPE_KEY = "glue"; + + @JsonProperty + private String warehousePath; + + @JsonProperty + private Map catalogProperties; + + @JsonProperty + private final Boolean caseSensitive; + private static final Logger log = new Logger(GlueIcebergCatalog.class); + + @JsonCreator + public GlueIcebergCatalog( + @JsonProperty("warehousePath") String warehousePath, + @JsonProperty("catalogProperties") @Nullable + Map catalogProperties, + @JsonProperty("caseSensitive") Boolean caseSensitive, + @JacksonInject @Json ObjectMapper mapper + ) + { + this.warehousePath = Preconditions.checkNotNull(warehousePath, "warehousePath cannot be null"); + this.catalogProperties = DynamicConfigProviderUtils.extraConfigAndSetStringMap(catalogProperties, DRUID_DYNAMIC_CONFIG_PROVIDER_KEY, mapper); + this.caseSensitive = caseSensitive == null ? true : caseSensitive; + this.catalog = retrieveCatalog(); + } + + @Override + public Catalog retrieveCatalog() { + if (catalog == null) { + log.info("catalog is null, setting up default glue catalog."); + catalog = setupGlueCatalog(); + } + log.info("Glue catalog set [%s].", catalog.toString()); + return catalog; + } + + private Catalog setupGlueCatalog() { + catalog = new GlueCatalog(); + catalogProperties.put(CatalogProperties.WAREHOUSE_LOCATION, warehousePath); + catalog.initialize(CATALOG_NAME, catalogProperties); + return catalog; + } + + @Override + public boolean isCaseSensitive() + { + return caseSensitive; + } } From e6efb4add6aecefcbc148a4c5b2b5adc9ca8160c Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Thu, 17 Oct 2024 23:19:51 -0400 Subject: [PATCH 04/26] basic tests added --- .../iceberg/input/GlueIcebergCatalogTest.java | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java new file mode 100644 index 000000000000..a9671503d362 --- /dev/null +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -0,0 +1,41 @@ +package org.apache.druid.iceberg.input; + + +import com.fasterxml.jackson.databind.ObjectMapper; +import org.apache.druid.jackson.DefaultObjectMapper; +import org.apache.druid.java.util.common.FileUtils; +import org.junit.Assert; +import org.junit.Test; + +import java.io.File; +import java.util.HashMap; + +public class GlueIcebergCatalogTest { + private final ObjectMapper mapper = new DefaultObjectMapper(); + public void setUp() throws Exception { + } + + public void tearDown() throws Exception { + } + + @Test + public void testCatalogCreate() { + GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( + "s3://testbucket/testpath", + new HashMap<>(), + true, + mapper + ); + Assert.assertEquals("glue", glueCatalog.retrieveCatalog().name()); + } + @Test + public void testIsCaseSensitive() { + GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( + "s3://testbucket/testpath", + new HashMap<>(), + true, + mapper + ); + Assert.assertEquals(true, glueCatalog.isCaseSensitive()); + } +} \ No newline at end of file From f3117065b5b0b787c35e4c0a0f1f351486f35147 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Fri, 18 Oct 2024 20:44:33 -0400 Subject: [PATCH 05/26] removed dependecy iceberg-aws-bundle --- extensions-contrib/druid-iceberg-extensions/pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 029af8f46bfb..3d2af93f50e3 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -271,11 +271,6 @@ iceberg-hive-metastore ${iceberg.core.version} - - org.apache.iceberg - iceberg-aws-bundle - ${iceberg.core.version} - org.apache.iceberg iceberg-aws From f211f8ed462bf25c08a3fd70768ed5ed5cce93bc Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Sun, 20 Oct 2024 23:18:43 +0530 Subject: [PATCH 06/26] glue catalog support - docs update for iceberg --- docs/development/extensions-contrib/iceberg.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/development/extensions-contrib/iceberg.md b/docs/development/extensions-contrib/iceberg.md index 041453930334..e2a5a06cb9ec 100644 --- a/docs/development/extensions-contrib/iceberg.md +++ b/docs/development/extensions-contrib/iceberg.md @@ -31,12 +31,12 @@ Apache Iceberg is an open table format for huge analytic datasets. [IcebergInput Iceberg manages most of its metadata in metadata files in the object storage. However, it is still dependent on a metastore to manage a certain amount of metadata. Iceberg refers to these metastores as catalogs. The Iceberg extension lets you connect to the following Iceberg catalog types: + +* Glue catalog * REST-based catalog * Hive metastore catalog * Local catalog -Druid does not support AWS Glue catalog yet. - For a given catalog, Iceberg input source reads the table name from the catalog, applies the filters, and extracts all the underlying live data files up to the latest snapshot. The data files can be in Parquet, ORC, or Avro formats. The data files typically reside in a warehouse location, which can be in HDFS, S3, or the local filesystem. The `druid-iceberg-extensions` extension relies on the existing input source connectors in Druid to read the data files from the warehouse. Therefore, the Iceberg input source can be considered as an intermediate input source, which provides the file paths for other input source implementations. @@ -116,6 +116,12 @@ The `warehouseSource` is set to `local` because this catalog only supports readi To connect to an Iceberg REST Catalog server, configure the `icebergCatalog` type as `rest`. The Iceberg REST Open API spec gives catalogs greater control over the implementation and in most cases, the `warehousePath` does not have to be provided by the client. Security credentials may be provided in the `catalogProperties` object. +## Glue catalog + +Configure the `icebergCatalog` type as `glue`.`warehousePath` and properties must be provided in `catalogProperties` object. +Refer [Iceberg Glue Catalog documentation](https://iceberg.apache.org/docs/1.6.0/aws/#glue-catalog) for setting properties. + + ## Downloading Iceberg extension To download `druid-iceberg-extensions`, run the following command after replacing `` with the desired From fc68a48f94d777ffa04c564d8bf7013013ab2148 Mon Sep 17 00:00:00 2001 From: Shekhar Rajak Date: Tue, 22 Oct 2024 09:49:00 +0530 Subject: [PATCH 07/26] Update IcebergDruidModule.java --- .../org/apache/druid/iceberg/common/IcebergDruidModule.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java index bbbbe17df0b8..20fafa0d5826 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java @@ -25,7 +25,7 @@ import com.google.inject.Binder; import org.apache.druid.error.DruidException; import org.apache.druid.iceberg.guice.HiveConf; -import org.apache.druid.iceberg.input.*; +import org.apache.druid.iceberg.input.GlueIcebergCatalog; import org.apache.druid.initialization.DruidModule; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; From efeac8431257343b2c8e896bec4a7a02fbd090ba Mon Sep 17 00:00:00 2001 From: Shekhar Rajak Date: Tue, 22 Oct 2024 09:49:47 +0530 Subject: [PATCH 08/26] Update IcebergDruidModule.java --- .../org/apache/druid/iceberg/common/IcebergDruidModule.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java index 20fafa0d5826..488a8393a5f6 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java @@ -25,6 +25,10 @@ import com.google.inject.Binder; import org.apache.druid.error.DruidException; import org.apache.druid.iceberg.guice.HiveConf; +import org.apache.druid.iceberg.input.HiveIcebergCatalog; +import org.apache.druid.iceberg.input.IcebergInputSource; +import org.apache.druid.iceberg.input.LocalCatalog; +import org.apache.druid.iceberg.input.RestIcebergCatalog; import org.apache.druid.iceberg.input.GlueIcebergCatalog; import org.apache.druid.initialization.DruidModule; import org.apache.hadoop.conf.Configuration; From 8cec6958171e118950ce06811af00f641579f3e4 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Sat, 26 Oct 2024 01:00:30 +0530 Subject: [PATCH 09/26] updates in dependencies and warehousePath must be under catalogProp --- .../druid-iceberg-extensions/pom.xml | 25 ++++++++++++++++- .../iceberg/input/GlueIcebergCatalog.java | 28 ++++++++++++------- .../iceberg/input/GlueIcebergCatalogTest.java | 2 -- 3 files changed, 42 insertions(+), 13 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 3d2af93f50e3..02990345c0b4 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -36,6 +36,7 @@ 1.6.1 + 2.28.28 3.1.3 @@ -276,7 +277,29 @@ iceberg-aws ${iceberg.core.version} - + + + software.amazon.awssdk + bundle + ${awssdk.version} + + + + org.apache.iceberg + iceberg-aws-bundle + 1.5.2 + + + + org.apache.avro + avro + 1.11.1 + + + software.amazon.awssdk + url-connection-client + ${awssdk.version} + org.apache.hive hive-metastore diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 17d993c2bc7f..ec4f6a4b66c3 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -8,7 +8,9 @@ import org.apache.druid.guice.annotations.Json; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.utils.DynamicConfigProviderUtils; +import org.apache.hadoop.conf.Configuration; import org.apache.iceberg.CatalogProperties; +import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; import org.apache.iceberg.aws.glue.GlueCatalog; import javax.annotation.Nullable; @@ -20,9 +22,6 @@ public class GlueIcebergCatalog extends IcebergCatalog { public static final String TYPE_KEY = "glue"; - @JsonProperty - private String warehousePath; - @JsonProperty private Map catalogProperties; @@ -30,16 +29,26 @@ public class GlueIcebergCatalog extends IcebergCatalog { private final Boolean caseSensitive; private static final Logger log = new Logger(GlueIcebergCatalog.class); + /* + * catalogProperties must have all the config that iceberg glue catalog expect. + * Ref: https://iceberg.apache.org/docs/nightly/kafka-connect/?h=kafka#glue-example + * and https://iceberg.apache.org/concepts/catalog/?h=catalog + * + * e.g. + * "catalogProperties" : + { + "type" : "glue", + "io-impl": "org.apache.iceberg.aws.s3.S3FileIO", + "warehouse": "s3://bucket/iceberg_catalog/druid/warehouse" + } + * */ @JsonCreator public GlueIcebergCatalog( - @JsonProperty("warehousePath") String warehousePath, - @JsonProperty("catalogProperties") @Nullable - Map catalogProperties, + @JsonProperty("catalogProperties") @Nullable Map catalogProperties, @JsonProperty("caseSensitive") Boolean caseSensitive, @JacksonInject @Json ObjectMapper mapper ) { - this.warehousePath = Preconditions.checkNotNull(warehousePath, "warehousePath cannot be null"); this.catalogProperties = DynamicConfigProviderUtils.extraConfigAndSetStringMap(catalogProperties, DRUID_DYNAMIC_CONFIG_PROVIDER_KEY, mapper); this.caseSensitive = caseSensitive == null ? true : caseSensitive; this.catalog = retrieveCatalog(); @@ -56,9 +65,8 @@ public Catalog retrieveCatalog() { } private Catalog setupGlueCatalog() { - catalog = new GlueCatalog(); - catalogProperties.put(CatalogProperties.WAREHOUSE_LOCATION, warehousePath); - catalog.initialize(CATALOG_NAME, catalogProperties); + // We are not passing any hadoop config, third parameter is null + catalog = CatalogUtil.buildIcebergCatalog(CATALOG_NAME, catalogProperties, null); return catalog; } diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index a9671503d362..bd078fe98650 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -21,7 +21,6 @@ public void tearDown() throws Exception { @Test public void testCatalogCreate() { GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( - "s3://testbucket/testpath", new HashMap<>(), true, mapper @@ -31,7 +30,6 @@ public void testCatalogCreate() { @Test public void testIsCaseSensitive() { GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( - "s3://testbucket/testpath", new HashMap<>(), true, mapper From 78c53ab00d4d8b9d82aed63ce24b7b3a3c557992 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Sat, 26 Oct 2024 01:33:01 +0530 Subject: [PATCH 10/26] removed some dependencies - which not required --- .../druid-iceberg-extensions/pom.xml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 02990345c0b4..5c83e4ffbc38 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -283,23 +283,12 @@ bundle ${awssdk.version} - - - org.apache.iceberg - iceberg-aws-bundle - 1.5.2 - - + org.apache.avro avro 1.11.1 - - - software.amazon.awssdk - url-connection-client - ${awssdk.version} - + org.apache.hive hive-metastore From 4df3857bb790711a3781779380dccf4981d28865 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Mon, 28 Oct 2024 23:29:56 +0530 Subject: [PATCH 11/26] only glue sdk added --- extensions-contrib/druid-iceberg-extensions/pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 5c83e4ffbc38..31140ad688a1 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -280,10 +280,10 @@ software.amazon.awssdk - bundle + glue ${awssdk.version} - + org.apache.avro avro From 4bae037ba9e9f93aa0b95c490b566367600cc503 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:29:38 +0530 Subject: [PATCH 12/26] update license --- .../iceberg/input/GlueIcebergCatalog.java | 19 +++++++++++++++++++ .../iceberg/input/GlueIcebergCatalogTest.java | 19 +++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index ec4f6a4b66c3..953d15e62965 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.druid.iceberg.input; import com.fasterxml.jackson.annotation.JacksonInject; diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index bd078fe98650..793c50e7754b 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + package org.apache.druid.iceberg.input; From a617d4deeadd7f84a515aa24f4d1af28c46ed5b3 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:33:03 +0530 Subject: [PATCH 13/26] avro exclusion removed --- extensions-contrib/druid-iceberg-extensions/pom.xml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 31140ad688a1..e6966032a92f 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -154,10 +154,6 @@ com.google.guava guava - - org.apache.avro - avro - net.java.dev.jets3t jets3t @@ -283,12 +279,6 @@ glue ${awssdk.version} - - - org.apache.avro - avro - 1.11.1 - org.apache.hive hive-metastore From 02e18e2184507243a94cfed2759a702355acea51 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:43:40 +0530 Subject: [PATCH 14/26] doc update --- docs/ingestion/input-sources.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/docs/ingestion/input-sources.md b/docs/ingestion/input-sources.md index 4583ff40f595..c945b3dcb816 100644 --- a/docs/ingestion/input-sources.md +++ b/docs/ingestion/input-sources.md @@ -1065,7 +1065,7 @@ The following is a sample spec for a S3 warehouse source: ### Catalog Object -The catalog object supports `rest`, `hive` and `local` catalog types. +The catalog object supports `rest`, `hive`, `glue` and `local` catalog types. The following table lists the properties of a `local` catalog: @@ -1094,6 +1094,32 @@ The following table lists the properties of a `rest` catalog: |catalogUri|The URI associated with the catalog's HTTP endpoint.|None|yes| |catalogProperties|Map of any additional properties that needs to be attached to the catalog.|None|no| +The following table lists the properties of a `glue` catalog: + +|Property| Description |Default| Required | +|--------|------------------------------------------------------------------------------------------------------------------------------------------------------|-------|----------| +|type| Set this value to `glue`. |None| yes | +|catalogProperties| Map of any additional properties that needs to be attached to the catalog. This expects all the config as per [Iceberg Catalog configuration docs](https://iceberg.apache.org/docs/latest/configuration/#catalog-properties) |None| Yes | + +Sample: + +```angular2html +... +"icebergCatalog": +{ + "type" : "glue", + "catalogName": "some_catalog_name", + "catalogProperties" : + { + "type" : "glue", + "warehouse": "s3a://bucket/warehouse", + "io-impl": "org.apache.iceberg.aws.s3.S3FileIO" + } +} +.. +``` + + ### Iceberg filter object This input source provides the following filters: `and`, `equals`, `interval`, and `or`. You can use these filters to filter out data files from a snapshot, reducing the number of files Druid has to ingest. From ead345dec41e0203ef97ce45073227e982159c7a Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:50:08 +0530 Subject: [PATCH 15/26] doc update --- docs/ingestion/input-sources.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/ingestion/input-sources.md b/docs/ingestion/input-sources.md index c945b3dcb816..e004b9d587a7 100644 --- a/docs/ingestion/input-sources.md +++ b/docs/ingestion/input-sources.md @@ -1111,7 +1111,6 @@ Sample: "catalogName": "some_catalog_name", "catalogProperties" : { - "type" : "glue", "warehouse": "s3a://bucket/warehouse", "io-impl": "org.apache.iceberg.aws.s3.S3FileIO" } From bc7a6abae95721c4f0623573cd3992fc5a7e85a8 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:50:25 +0530 Subject: [PATCH 16/26] set the type to glue --- .../org/apache/druid/iceberg/input/GlueIcebergCatalog.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 953d15e62965..b6e30efed8aa 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -32,7 +32,10 @@ import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; import org.apache.iceberg.aws.glue.GlueCatalog; +import org.apache.iceberg.util.PropertyUtil; + import javax.annotation.Nullable; +import java.util.Locale; import java.util.Map; public class GlueIcebergCatalog extends IcebergCatalog { @@ -85,6 +88,7 @@ public Catalog retrieveCatalog() { private Catalog setupGlueCatalog() { // We are not passing any hadoop config, third parameter is null + catalogProperties.put("type", TYPE_KEY); catalog = CatalogUtil.buildIcebergCatalog(CATALOG_NAME, catalogProperties, null); return catalog; } From 928c3ce92834fa02cdc7b38a17cf2aabbde5c145 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 07:54:29 +0530 Subject: [PATCH 17/26] minor change --- docs/ingestion/input-sources.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/ingestion/input-sources.md b/docs/ingestion/input-sources.md index e004b9d587a7..d739a5fa8bb9 100644 --- a/docs/ingestion/input-sources.md +++ b/docs/ingestion/input-sources.md @@ -1107,8 +1107,7 @@ Sample: ... "icebergCatalog": { - "type" : "glue", - "catalogName": "some_catalog_name", + "type" : "glue", "catalogProperties" : { "warehouse": "s3a://bucket/warehouse", From 2b0cfbab808d60b5484a723188cd24305b37ea28 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 09:47:34 +0530 Subject: [PATCH 18/26] minor change --- .../org/apache/druid/iceberg/input/GlueIcebergCatalog.java | 6 ------ .../apache/druid/iceberg/input/GlueIcebergCatalogTest.java | 3 --- 2 files changed, 9 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index b6e30efed8aa..32bf41f8bdab 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -23,19 +23,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; -import com.google.common.base.Preconditions; import org.apache.druid.guice.annotations.Json; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.utils.DynamicConfigProviderUtils; -import org.apache.hadoop.conf.Configuration; -import org.apache.iceberg.CatalogProperties; import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; -import org.apache.iceberg.aws.glue.GlueCatalog; -import org.apache.iceberg.util.PropertyUtil; import javax.annotation.Nullable; -import java.util.Locale; import java.util.Map; public class GlueIcebergCatalog extends IcebergCatalog { diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index 793c50e7754b..396d1696cddc 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -22,11 +22,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.druid.jackson.DefaultObjectMapper; -import org.apache.druid.java.util.common.FileUtils; import org.junit.Assert; import org.junit.Test; - -import java.io.File; import java.util.HashMap; public class GlueIcebergCatalogTest { From 9cc2423e93a9198f9fedca994c8bfcc3bdb9b55e Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 10:57:46 +0530 Subject: [PATCH 19/26] fixing codestyle --- .../iceberg/input/GlueIcebergCatalog.java | 114 +++++++++--------- .../iceberg/input/GlueIcebergCatalogTest.java | 49 ++++---- 2 files changed, 84 insertions(+), 79 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 32bf41f8bdab..c8bdee1c22f0 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -23,73 +23,79 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.Map; +import javax.annotation.Nullable; import org.apache.druid.guice.annotations.Json; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.utils.DynamicConfigProviderUtils; import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; -import javax.annotation.Nullable; -import java.util.Map; - +/** + * Glue specific implementation of iceberg catalog. + * It expects Catalog Properties key:value pair, which is iceberg compatible: + * https://iceberg.apache.org/docs/latest/configuration/#catalog-properties + */ public class GlueIcebergCatalog extends IcebergCatalog { - private static final String CATALOG_NAME = "glue"; - private Catalog catalog; + private static final String CATALOG_NAME = "glue"; + private Catalog catalog; - public static final String TYPE_KEY = "glue"; + public static final String TYPE_KEY = "glue"; - @JsonProperty - private Map catalogProperties; + @JsonProperty + private Map catalogProperties; - @JsonProperty - private final Boolean caseSensitive; - private static final Logger log = new Logger(GlueIcebergCatalog.class); + @JsonProperty + private final Boolean caseSensitive; + private static final Logger log = new Logger(GlueIcebergCatalog.class); - /* - * catalogProperties must have all the config that iceberg glue catalog expect. - * Ref: https://iceberg.apache.org/docs/nightly/kafka-connect/?h=kafka#glue-example - * and https://iceberg.apache.org/concepts/catalog/?h=catalog - * - * e.g. - * "catalogProperties" : - { - "type" : "glue", - "io-impl": "org.apache.iceberg.aws.s3.S3FileIO", - "warehouse": "s3://bucket/iceberg_catalog/druid/warehouse" - } - * */ - @JsonCreator - public GlueIcebergCatalog( - @JsonProperty("catalogProperties") @Nullable Map catalogProperties, - @JsonProperty("caseSensitive") Boolean caseSensitive, - @JacksonInject @Json ObjectMapper mapper - ) - { - this.catalogProperties = DynamicConfigProviderUtils.extraConfigAndSetStringMap(catalogProperties, DRUID_DYNAMIC_CONFIG_PROVIDER_KEY, mapper); - this.caseSensitive = caseSensitive == null ? true : caseSensitive; - this.catalog = retrieveCatalog(); - } + /** + * catalogProperties must have all the config that iceberg glue catalog expect. + * Ref: https://iceberg.apache.org/docs/nightly/kafka-connect/?h=kafka#glue-example + * and https://iceberg.apache.org/concepts/catalog/?h=catalog + * e.g. + * "catalogProperties" : + { + "type" : "glue", + "io-impl": "org.apache.iceberg.aws.s3.S3FileIO", + "warehouse": "s3://bucket/iceberg_catalog/druid/warehouse" + } + * + * */ + @JsonCreator + public GlueIcebergCatalog( + @JsonProperty("catalogProperties") @Nullable Map catalogProperties, + @JsonProperty("caseSensitive") Boolean caseSensitive, + @JacksonInject @Json ObjectMapper mapper + ) { + this.catalogProperties = DynamicConfigProviderUtils.extraConfigAndSetStringMap( + catalogProperties, + DRUID_DYNAMIC_CONFIG_PROVIDER_KEY, + mapper + ); + this.caseSensitive = caseSensitive == null ? true : caseSensitive; + this.catalog = retrieveCatalog(); + } - @Override - public Catalog retrieveCatalog() { - if (catalog == null) { - log.info("catalog is null, setting up default glue catalog."); - catalog = setupGlueCatalog(); - } - log.info("Glue catalog set [%s].", catalog.toString()); - return catalog; + @Override + public Catalog retrieveCatalog() { + if (catalog == null) { + log.info("catalog is null, setting up default glue catalog."); + catalog = setupGlueCatalog(); } + log.info("Glue catalog set [%s].", catalog.toString()); + return catalog; + } - private Catalog setupGlueCatalog() { - // We are not passing any hadoop config, third parameter is null - catalogProperties.put("type", TYPE_KEY); - catalog = CatalogUtil.buildIcebergCatalog(CATALOG_NAME, catalogProperties, null); - return catalog; - } + private Catalog setupGlueCatalog() { + // We are not passing any hadoop config, third parameter is null + catalogProperties.put("type", TYPE_KEY); + catalog = CatalogUtil.buildIcebergCatalog(CATALOG_NAME, catalogProperties, null); + return catalog; + } - @Override - public boolean isCaseSensitive() - { - return caseSensitive; - } + @Override + public boolean isCaseSensitive() { + return caseSensitive; + } } diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index 396d1696cddc..b8dde21436a4 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -21,35 +21,34 @@ import com.fasterxml.jackson.databind.ObjectMapper; +import java.util.HashMap; import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; -import java.util.HashMap; -public class GlueIcebergCatalogTest { - private final ObjectMapper mapper = new DefaultObjectMapper(); - public void setUp() throws Exception { - } +/** + * Test cases for GlueCatalog Iceberg extension. + * */ +public class GlueIcebergCatalogTest { + private final ObjectMapper mapper = new DefaultObjectMapper(); - public void tearDown() throws Exception { - } + @Test + public void testCatalogCreate() { + GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( + new HashMap<>(), + true, + mapper + ); + Assert.assertEquals("glue", glueCatalog.retrieveCatalog().name()); + } - @Test - public void testCatalogCreate() { - GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( - new HashMap<>(), - true, - mapper - ); - Assert.assertEquals("glue", glueCatalog.retrieveCatalog().name()); - } - @Test - public void testIsCaseSensitive() { - GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( - new HashMap<>(), - true, - mapper - ); - Assert.assertEquals(true, glueCatalog.isCaseSensitive()); - } + @Test + public void testIsCaseSensitive() { + GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( + new HashMap<>(), + true, + mapper + ); + Assert.assertEquals(true, glueCatalog.isCaseSensitive()); + } } \ No newline at end of file From 9cf321f684ce8b5ab8f15fb8b9e64a0886965bb4 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Tue, 5 Nov 2024 23:37:02 +0530 Subject: [PATCH 20/26] checkstyle fixes --- .../druid/iceberg/common/IcebergDruidModule.java | 2 +- .../druid/iceberg/input/GlueIcebergCatalog.java | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java index 488a8393a5f6..d238cccc248c 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/common/IcebergDruidModule.java @@ -25,11 +25,11 @@ import com.google.inject.Binder; import org.apache.druid.error.DruidException; import org.apache.druid.iceberg.guice.HiveConf; +import org.apache.druid.iceberg.input.GlueIcebergCatalog; import org.apache.druid.iceberg.input.HiveIcebergCatalog; import org.apache.druid.iceberg.input.IcebergInputSource; import org.apache.druid.iceberg.input.LocalCatalog; import org.apache.druid.iceberg.input.RestIcebergCatalog; -import org.apache.druid.iceberg.input.GlueIcebergCatalog; import org.apache.druid.initialization.DruidModule; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.fs.FileSystem; diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index c8bdee1c22f0..8a614b098618 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -36,7 +36,8 @@ * It expects Catalog Properties key:value pair, which is iceberg compatible: * https://iceberg.apache.org/docs/latest/configuration/#catalog-properties */ -public class GlueIcebergCatalog extends IcebergCatalog { +public class GlueIcebergCatalog extends IcebergCatalog +{ private static final String CATALOG_NAME = "glue"; private Catalog catalog; @@ -67,7 +68,8 @@ public GlueIcebergCatalog( @JsonProperty("catalogProperties") @Nullable Map catalogProperties, @JsonProperty("caseSensitive") Boolean caseSensitive, @JacksonInject @Json ObjectMapper mapper - ) { + ) + { this.catalogProperties = DynamicConfigProviderUtils.extraConfigAndSetStringMap( catalogProperties, DRUID_DYNAMIC_CONFIG_PROVIDER_KEY, @@ -78,7 +80,8 @@ public GlueIcebergCatalog( } @Override - public Catalog retrieveCatalog() { + public Catalog retrieveCatalog() + { if (catalog == null) { log.info("catalog is null, setting up default glue catalog."); catalog = setupGlueCatalog(); @@ -87,7 +90,8 @@ public Catalog retrieveCatalog() { return catalog; } - private Catalog setupGlueCatalog() { + private Catalog setupGlueCatalog() + { // We are not passing any hadoop config, third parameter is null catalogProperties.put("type", TYPE_KEY); catalog = CatalogUtil.buildIcebergCatalog(CATALOG_NAME, catalogProperties, null); @@ -95,7 +99,8 @@ private Catalog setupGlueCatalog() { } @Override - public boolean isCaseSensitive() { + public boolean isCaseSensitive() + { return caseSensitive; } } From 67be0230d4f61b67366cb94d3484a6ad38ea656c Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 00:14:21 +0530 Subject: [PATCH 21/26] checkstyle fixes --- .../druid/iceberg/input/GlueIcebergCatalog.java | 8 +++++--- .../druid/iceberg/input/GlueIcebergCatalogTest.java | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 8a614b098618..48b9e96dc36d 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -23,13 +23,15 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.Map; + import javax.annotation.Nullable; -import org.apache.druid.guice.annotations.Json; -import org.apache.druid.java.util.common.logger.Logger; +import java.util.Map; + import org.apache.druid.utils.DynamicConfigProviderUtils; +import org.apache.druid.java.util.common.logger.Logger; import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; +import org.apache.druid.guice.annotations.Json; /** * Glue specific implementation of iceberg catalog. diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index b8dde21436a4..9f9d29586961 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -22,6 +22,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import java.util.HashMap; + import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; @@ -29,11 +30,13 @@ /** * Test cases for GlueCatalog Iceberg extension. * */ -public class GlueIcebergCatalogTest { +public class GlueIcebergCatalogTest +{ private final ObjectMapper mapper = new DefaultObjectMapper(); @Test - public void testCatalogCreate() { + public void testCatalogCreate() + { GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( new HashMap<>(), true, @@ -43,7 +46,8 @@ public void testCatalogCreate() { } @Test - public void testIsCaseSensitive() { + public void testIsCaseSensitive() + { GlueIcebergCatalog glueCatalog = new GlueIcebergCatalog( new HashMap<>(), true, @@ -51,4 +55,4 @@ public void testIsCaseSensitive() { ); Assert.assertEquals(true, glueCatalog.isCaseSensitive()); } -} \ No newline at end of file +} From 6145f5f3185404ad5b091dbc489c5564d3890e81 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 00:21:20 +0530 Subject: [PATCH 22/26] checkstyle fixes --- .../druid/iceberg/input/GlueIcebergCatalog.java | 11 +++++------ .../druid/iceberg/input/GlueIcebergCatalogTest.java | 4 ++-- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java index 48b9e96dc36d..9919ac7f8475 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java +++ b/extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java @@ -23,15 +23,14 @@ import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.databind.ObjectMapper; - -import javax.annotation.Nullable; -import java.util.Map; - -import org.apache.druid.utils.DynamicConfigProviderUtils; +import org.apache.druid.guice.annotations.Json; import org.apache.druid.java.util.common.logger.Logger; +import org.apache.druid.utils.DynamicConfigProviderUtils; import org.apache.iceberg.CatalogUtil; import org.apache.iceberg.catalog.Catalog; -import org.apache.druid.guice.annotations.Json; + +import javax.annotation.Nullable; +import java.util.Map; /** * Glue specific implementation of iceberg catalog. diff --git a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java index 9f9d29586961..d748911181ef 100644 --- a/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java +++ b/extensions-contrib/druid-iceberg-extensions/src/test/java/org/apache/druid/iceberg/input/GlueIcebergCatalogTest.java @@ -21,12 +21,12 @@ import com.fasterxml.jackson.databind.ObjectMapper; -import java.util.HashMap; - import org.apache.druid.jackson.DefaultObjectMapper; import org.junit.Assert; import org.junit.Test; +import java.util.HashMap; + /** * Test cases for GlueCatalog Iceberg extension. * */ From 81aaa14268351f0cb041c1fc0a5ef26d85dbcc4c Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 00:50:03 +0530 Subject: [PATCH 23/26] dependency check fixes --- extensions-contrib/druid-iceberg-extensions/pom.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index e6966032a92f..40ca7265c2df 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -272,12 +272,14 @@ org.apache.iceberg iceberg-aws ${iceberg.core.version} + runtime software.amazon.awssdk glue ${awssdk.version} + runtime org.apache.hive From a7a4dafe471c8b700d0f3782e65749765de63af7 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 02:55:12 +0530 Subject: [PATCH 24/26] update pom for ignore warning for glue catalog --- pom.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pom.xml b/pom.xml index e70542cdea64..a4462e6a8673 100644 --- a/pom.xml +++ b/pom.xml @@ -1826,6 +1826,22 @@ org.apache.maven.plugins maven-dependency-plugin 3.1.1 + + + analyze + + analyze-only + + + true + + + org.apache.iceberg:iceberg-aws + software.amazon.awssdk:glue + + + + org.apache.maven.plugins From eb94233d9b8fc0c923268512e20c197959574d54 Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 02:55:39 +0530 Subject: [PATCH 25/26] compile scope needed - iceberg-aws and awssdk --- extensions-contrib/druid-iceberg-extensions/pom.xml | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index 40ca7265c2df..e6966032a92f 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -272,14 +272,12 @@ org.apache.iceberg iceberg-aws ${iceberg.core.version} - runtime software.amazon.awssdk glue ${awssdk.version} - runtime org.apache.hive From b0edb4eca9db9ab4a6401c8e133b7d5b41f55f9d Mon Sep 17 00:00:00 2001 From: SHEKHAR PRASAD RAJAK Date: Wed, 6 Nov 2024 09:13:13 +0530 Subject: [PATCH 26/26] updates pom with comment --- extensions-contrib/druid-iceberg-extensions/pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions-contrib/druid-iceberg-extensions/pom.xml b/extensions-contrib/druid-iceberg-extensions/pom.xml index e6966032a92f..a36561cff055 100644 --- a/extensions-contrib/druid-iceberg-extensions/pom.xml +++ b/extensions-contrib/druid-iceberg-extensions/pom.xml @@ -268,12 +268,13 @@ iceberg-hive-metastore ${iceberg.core.version} + org.apache.iceberg iceberg-aws ${iceberg.core.version} - + software.amazon.awssdk glue