question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[SUPPORT] Should we shade all aws dependencies to avoid class conflicts?

See original GitHub issue

As we introduce support for DynamoDb based lock by HUDI-2314, can we shade all aws dependencies for all our bundled jars(spark, flink)? As many users also import their own aws packages but also use hudi, which could cause many class conflicts like following error:

java.lang.NoSuchMethodError: com.amazonaws.http.HttpResponse.getHttpRequest()Lcom/amazonaws/thirdparty/apache/http/client/methods/HttpRequestBase;
	at com.amazonaws.services.s3.internal.S3ObjectResponseHandler.abortableIs(S3ObjectResponseHandler.java:64)
	at com.amazonaws.services.s3.internal.S3ObjectResponseHandler.handle(S3ObjectResponseHandler.java:57)

I’m not sure whether shading these jars will introduce other issues or not. @zhedoubushishi Can you take a look at this issue?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:16 (12 by maintainers)

github_iconTop GitHub Comments

5reactions
xushiyancommented, Jan 7, 2022

After some discussions, we think that we should keep cloud provider’s jars out of open source bundle jars. Any cloud provider can create its own specific hudi module and hudi bundle jars. (like hudi-aws and hudi-spark-aws-bundle for example) But open source bundle jars should stay neutral. cc @danny0405 @nsivabalan @codope @vinothchandar @zhedoubushishi @umehrot2

I’ve pivoted this ticket to removing bundle deps to align with flink bundle changes. https://issues.apache.org/jira/browse/HUDI-3157

If we just directly remove the shading for aws jars, then we need to manually pass aws jars in the Spark/Flink classpath when the users are using AWS Dynamodb/cloudwatch features.

@zhedoubushishi If to help users use the bundle a bit easier, as I suggested above, please consider adding an aws specific hudi bundle to resolve dependency problem. Hope this could align with your thoughts too.

4reactions
boneanxscommented, Dec 30, 2021

For our internal hudi version, we shade aws dependencies, you can add new relocation and build a new bundle package:

For example, to shade aws dependencies in spark, add following codes in packaging/hudi-spark-bundle/pom.xml

<!-- line 185-->
<relocation>
 <pattern>com.amazonaws.</pattern>
 <shadedPattern>${spark.bundle.spark.shade.prefix}com.amazonaws.</shadedPattern>
</relocation>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Java SDK Bundled Dependency | AWS Developer Tools Blog
We 're pleased to introduce the AWS SDK for Java Bundle dependency. This new module that you can include in your maven project...
Read more >
Unable to resolve dependency conflict b/w google-vision beta ...
I 'm encountering dependency conflicts on jackson-core as both google-api and aws-java-sdk are using two different versions. Dependency Hierarchy.
Read more >
Java Class Shadowing and Shading - Medium
Rather than shading every single transitive dependency, we're going to opt to not shade netty and slf4j-api since they are widely-used libraries ...
Read more >
Troubleshoot dependency version conflicts - Azure
Application dependency conflict: your application uses Jackson 2.9 directly and while you're working on updating your code, you can shade and ...
Read more >
How to Create a Fat Jar Using Maven - Quick Programming Tips
This will ensure that whenever you call the maven package task, all the ... It is possible to relocate the dependent classes to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found