You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "Shekharrajak (via GitHub)" <gi...@apache.org> on 2024/10/22 18:27:16 UTC
[PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Shekharrajak opened a new pull request, #17392:
URL: https://github.com/apache/druid/pull/17392
Fixes https://github.com/apache/druid/issues/17352.
### Description
<!-- Describe the goal of this PR, what problem are you fixing. If there is a corresponding issue (referenced above), it's not necessary to repeat the description here, however, you may choose to keep one summary sentence. -->
<!-- Describe your patch: what did you change in code? How did you fix the problem? -->
<!-- If there are several relatively logically separate changes in this PR, create a mini-section for each of them. For example: -->
#### Fixed the bug ...
#### Renamed the class ...
#### Added a forbidden-apis entry ...
<!--
In each section, please describe design decisions made, including:
- Choice of algorithms
- Behavioral aspects. What configuration values are acceptable? How are corner cases and error conditions handled, such as when there are insufficient resources?
- Class organization and design (how the logic is split between classes, inheritance, composition, design patterns)
- Method organization and design (how the logic is split between methods, parameters and return types)
- Naming (class, method, API, configuration, HTTP endpoint, names of emitted metrics)
-->
<!-- It's good to describe an alternative design (or mention an alternative name) for every design (or naming) decision point and compare the alternatives with the designs that you've implemented (or the names you've chosen) to highlight the advantages of the chosen designs and names. -->
<!-- If there was a discussion of the design of the feature implemented in this PR elsewhere (e. g. a "Proposal" issue, any other issue, or a thread in the development mailing list), link to that discussion from this PR description and explain what have changed in your final design compared to your original proposal or the consensus version in the end of the discussion. If something hasn't changed since the original discussion, you can omit a detailed discussion of those aspects of the design here, perhaps apart from brief mentioning for the sake of readability of this PR description. -->
<!-- Some of the aspects mentioned above may be omitted for simple and small changes. -->
#### Release note
<!-- Give your best effort to summarize your changes in a couple of sentences aimed toward Druid users.
If your change doesn't have end user impact, you can skip this section.
For tips about how to write a good release note, see [Release notes](https://github.com/apache/druid/blob/master/CONTRIBUTING.md#release-notes).
-->
<hr>
##### Key changed/added classes in this PR
* `GlueIcebergCatalog`
<hr>
<!-- Check the items by putting "x" in the brackets for the done things. Not all of these items apply to every PR. Remove the items which are not done or not relevant to the PR. None of the items from the checklist below are strictly necessary, but it would be very helpful if you at least self-review the PR. -->
This PR has:
- [ ] been self-reviewed.
- [ ] using the [concurrency checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md) (Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [ ] a release note entry in the PR description.
- [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
- [ ] added unit tests or modified existing tests to cover new code paths, ensuring the threshold for [code coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md) is met.
- [ ] added integration tests.
- [ ] been tested in a test Druid cluster.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1811226179
##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java:
##########
@@ -0,0 +1,70 @@
+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<String, String> 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<String, Object> 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);
Review Comment:
AWS related env variables must be available where druid cluster is running.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1813211792
##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java:
##########
@@ -0,0 +1,70 @@
+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<String, String> 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<String, Object> 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);
Review Comment:
Yes, I will do that. Recently figured out that there is simpler approach in iceberg API itself to choose the catalog. I am spending sometime to check if that would drastically make it modular & work for all available iceberg catalog support on the fly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1817283922
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>bundle</artifactId>
+ <version>${awssdk.version}</version>
+ </dependency>
+<!-- org/apache/avro/LogicalType load-->
+ <dependency>
Review Comment:
Not sure! But I got error for no class definition while reading icebert data file
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>bundle</artifactId>
+ <version>${awssdk.version}</version>
+ </dependency>
+<!-- org/apache/avro/LogicalType load-->
+ <dependency>
Review Comment:
```
java.lang.NoClassDefFoundError: org/apache/avro/LogicalType iceberg
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2456088499
Update the doc and PR as per the review comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1817379867
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>bundle</artifactId>
Review Comment:
Could we replace this uber dependency with just the required AWS client dependencies for Glue? The bundle jar seems to add another 590MB to the extension.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1830040665
##########
pom.xml:
##########
@@ -1826,6 +1826,22 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <failOnWarning>true</failOnWarning>
+ <!-- ignore annotations for "unused but declared" warnings -->
Review Comment:
I don't see any compile time usages for these dependencies. Can we try setting `runtime` scope for these dependencies?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1819511113
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>bundle</artifactId>
Review Comment:
I will add just aws SDK Glue, I think that is sufficient.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1817282497
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
Review Comment:
Ref https://iceberg.apache.org/docs/1.6.0/aws/?h=aws+inte#enabling-aws-integration
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1821220553
##########
extensions-contrib/druid-iceberg-extensions/pom.xml:
##########
@@ -271,6 +272,22 @@
<artifactId>iceberg-hive-metastore</artifactId>
<version>${iceberg.core.version}</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.iceberg</groupId>
+ <artifactId>iceberg-aws</artifactId>
+ <version>${iceberg.core.version}</version>
+ </dependency>
+<!-- GlueCatalog class-->
+ <dependency>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>bundle</artifactId>
+ <version>${awssdk.version}</version>
+ </dependency>
+<!-- org/apache/avro/LogicalType load-->
+ <dependency>
Review Comment:
Instead of adding a new entry here, you can remove the apache avro dependency exclusion from the `hadoop-common` dependency
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2438667685
We need to have integration testing for glue catalog.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1811225149
##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java:
##########
@@ -0,0 +1,70 @@
+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<String, String> 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<String, Object> 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);
Review Comment:
catalog properties must have these key value pairs
```
"type" : "glue",
"catalog-impl": "org.apache.iceberg.aws.glue.GlueCatalog",
"io-impl": "org.apache.iceberg.aws.s3.S3FileIO",
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2430834872
While testing I find error:
```
Invalid value for the field [inputSource]. Reason: [Please make sure to load all the necessary extensions and jars with type 'iceberg' on 'druid/broker' service. Could not resolve type id 'iceberg' as a subtype of `org.apache.druid.data.input.InputSource` known type ids = [combining, hdfs, http, inline, local, nil, sql] at [Source: (String)"{"type":"iceberg","tableName": "
```
Please let me know if anyone have faced similar error message, it is related to not able to find IcebergInputSource from the iceberg extension as subtype for input source.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1830024256
##########
pom.xml:
##########
@@ -1826,6 +1826,22 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <failOnWarning>true</failOnWarning>
+ <!-- ignore annotations for "unused but declared" warnings -->
Review Comment:
These dependencies required at compile time.
We need to ignore warnings:
```
Warning: Unused declared dependencies found:
Warning: org.apache.iceberg:iceberg-aws:jar:1.6.1:compile
Warning: software.amazon.awssdk:glue:jar:2.28.28:compile
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2433271660
I reallise lib folder not copyting the jars from the druid-iceberg-extension/lib which is needed at runtime . When I copied those jar then GlueCatalog was detected and able to run load iceberg table
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2432915293
> Please add the extension to the broker load list, which should fix the error described.
Thanks! I found that there was already `druid.extensions.loadList` in common.runtime.properties file and it was overriding the below line that I added :
```
druid.extensions.loadList=["druid-iceberg-extensions"]
```
After adding into the existing list. I am able to run it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2444857809
@shekhar-rajak Catalog changes look good to me.
Do you mind adding some docs in https://github.com/apache/druid/blob/master/docs/ingestion/input-sources.md as well? Also please review and fix the CI failures.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 merged PR #17392:
URL: https://github.com/apache/druid/pull/17392
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1813119361
##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java:
##########
@@ -0,0 +1,70 @@
+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<String, String> 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<String, Object> 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);
Review Comment:
> AWS related env variables must be available where druid cluster is running.
Could we add more information related to this in the docs specific to the glue catalog?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "a2l007 (via GitHub)" <gi...@apache.org>.
a2l007 commented on PR #17392:
URL: https://github.com/apache/druid/pull/17392#issuecomment-2432748283
@shekhar-rajak Please add the extension to the broker load list, which should fix the error described.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1811225531
##########
extensions-contrib/druid-iceberg-extensions/src/main/java/org/apache/druid/iceberg/input/GlueIcebergCatalog.java:
##########
@@ -0,0 +1,70 @@
+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<String, String> 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<String, Object> 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);
Review Comment:
warehouse path must be s3://bucket/path
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] AWS Glue Catalog for Iceberg ingest extension (druid)
Posted by "Shekharrajak (via GitHub)" <gi...@apache.org>.
Shekharrajak commented on code in PR #17392:
URL: https://github.com/apache/druid/pull/17392#discussion_r1830348362
##########
pom.xml:
##########
@@ -1826,6 +1826,22 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
+ <executions>
+ <execution>
+ <id>analyze</id>
+ <goals>
+ <goal>analyze-only</goal>
+ </goals>
+ <configuration>
+ <failOnWarning>true</failOnWarning>
+ <!-- ignore annotations for "unused but declared" warnings -->
Review Comment:
Actually these dependency is needed at compile time otherwise we will have errors for testcases :
```
Error: org.apache.druid.iceberg.input.GlueIcebergCatalogTest.testCatalogCreate -- Time elapsed: 0.001 s <<< ERROR!
java.lang.BootstrapMethodError: java.lang.NoClassDefFoundError: software/amazon/awssdk/services/sts/model/Tag
at org.apache.iceberg.aws.AwsProperties.toStsTags(AwsProperties.java:412)
at org.apache.iceberg.aws.AwsProperties.<init>(AwsProperties.java:264)
at org.apache.iceberg.aws.AwsClientFactories$DefaultAwsClientFactory.initialize(AwsClientFactories.java:151)
at org.apache.iceberg.aws.AwsClientFactories.loadClientFactory(AwsClientFactories.java:88)
at org.apache.iceberg.aws.AwsClientFactories.from(AwsClientFactories.java:61)
at org.apache.iceberg.aws.glue.GlueCatalog.initialize(GlueCatalog.java:141)
```
<img width="1549" alt="image" src="https://github.com/user-attachments/assets/bd9e2a9c-0d5a-483e-95d8-ac42cd4d2ad5">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org