Skip to content

Bug Report: --datalake-formats = "" fails to exclude datalake format JARs in Glue ETL, causing "Multiple sources found" conflict

0

I am attempting to use Hudi 1.1.1 in an AWS 5.0 Glue job. To avoid conflicts with the pre-installed Glue Hudi libraries, I have set the job parameter --datalake-formats to an empty string (""). However, the Glue environment continues to load Hudi 0.15.0 into the System Classpath. The Spark UI "Classpath Entries " tab confirms the following JARs are still present in spark.driver.extraClassPath :

Classpath EntrySource Type
/usr/lib/hudi/hudi-aws-bundle-0.15.0-amzn-5.jarSystem Classpath
/usr/share/aws/iceberg/lib/iceberg-spark3-runtime.jarSystem Classpath
/usr/lib/hudi/hudi-spark3-bundle_2.12-0.15.0-amzn-5.jarSystem Classpath
/usr/lib/hudi/hudi-utilities-bundle_2.12-0.15.0-amzn-5.jarSystem Classpath

And spark.driver.extraClassPath still includes table formats like iceberg, delta :

:/usr/share/aws/iceberg/lib/iceberg-emr-common.jar:/usr/share/aws/iceberg/lib/iceberg-spark3-runtime.jar:/usr/share/aws/delta/lib/delta-spark.jar:/usr/share/aws/delta/lib/delta-storage.jar:/usr/lib/hudi/hudi-spark-bundle.jar

Consequences: When running SQL DDL or Spark reads, the job fails with: org.apache.spark.sql.AnalysisException: Multiple sources found for hudi (org.apache.hudi.BaseDefaultSource, org.apache.hudi.Spark32PlusDefaultSource) This occurs because Spark sees both the native 0.15.0 Hudi bundle and my provided 1.1.1 Hudi bundle.

Configurations Tried:

  • --datalake-formats not set at all (native AWS Hudi JARs still injected)
  • --datalake-formats set to "" (same issue)
  • --datalake-formats set to delta (same issue)
  • --user-jars-first set to true (Does not resolve the duplicate source error in SQL DDL)

How to enforce the --datalake-formats="" parameter for stopping Glue runtime to inject datalake JARs ?

2 Answers
0

Hello, Thank you for sharing this bug report. I can see you're experiencing a conflict between AWS Glue's pre-installed Hudi 0.15.0 libraries and your custom Hudi 1.1.1 JARs, where the --datalake-formats="" parameter is being ignored.

Based on my investigation of this issue, this appears to be issue with how the parameter is handled, and I see from the public documentation it is suggested as below:

Using a different Hudi version

To use a version of Hudi that AWS Glue doesn't support, specify your own Hudi JAR files using the --extra-jars job parameter. Do not include hudi as a value for the --datalake-formats job parameter. If you use AWS Glue 5.0 or above, you must set --user-jars-first true job parameter.

Recommended Solution

To work around this issue, please try the following configuration:

  1. Remove the --datalake-formats parameter entirely from your job configuration (don't set it to empty string or any value)
  2. Add the --extra-jars parameter with your Hudi 1.1.1 JAR files "hudi-spark3-bundle" and spark-avro, etc. compatible with Spark 3.5.4

[OR] Add the same S3 paths to the Dependent JARs path field under:

Job Details → Advanced Properties → Libraries → Dependent JARs path

&&

Set --user-jars-first=true to prioritize your custom JARs over system libraries This approach explicitly provides your custom Hudi version while allowing --user-jars-first to give it precedence over the system-installed libraries.

If the Issue Persists

If you continue to see the "Multiple sources found" error after implementing the above changes:

  • Test in AWS Glue 4.0 to confirm whether this behavior is specific to Glue 5.0
  • Open an AWS Support case with the following details:
  • Your job configuration (sanitized)
  • Spark UI classpath entries screenshot
  • Job execution logs showing the error
  • Confirmation of any behavioural differences between Glue 4.0 and 5.0

Thank you and have a good day!

AWS

answered 10 months ago

  • Hi, I tried using adding hudi bundles as S3 paths in --extra-jars and Glue 5.0 without any success. I noticed that AWS Glue 5.0 pre-loads Iceberg, Hudi and Delta in contrary to Glue 4.0 which requires --datalake-formats for them to load : https://aws.amazon.com/blogs/big-data/develop-and-test-aws-glue-5-0-jobs-locally-using-a-docker-container/#:~:text=Changes%20between%20the%20AWS%20Glue,specific%20table%20format%20is%20loaded .

    It does not make sense in our project to use Glue 4.0 since it has limited acces Lake Formation although it gives more control on the pre-loading process of datalake format bundles. Moreover, it is not compatible with my organisations' Glue job trait, which only supports the versions 5.0 and 5.1 because it loads pre-defined awssdk modules. If I change these, other jobs in my repository would fail.

    Is it possible to activate back this control level in Glue 5.0 and later ? It's a bit annoying not being able to deactivate old datalake version pre-loads and that they interfere with the version that we want to use. It's actually about bringing back the functionality of --datalake-formats parameter which turns out to be useless in recent Glue versions.

0

When using a custom version of Hudi (like 1.1.1) in AWS Glue, you're encountering a common issue where the native Hudi libraries (0.15.0) are still being loaded despite setting --datalake-formats to an empty string.

For custom Hudi versions in AWS Glue, you need to follow these specific steps:

  1. Do not include "hudi" in the --datalake-formats parameter. Setting it to an empty string ("") should work, but as you've discovered, there may be issues with this approach.

  2. Upload your custom Hudi JAR files to Amazon S3.

  3. Set the --extra-jars parameter to point to your custom Hudi JAR files in S3.

  4. For AWS Glue 5.0 and above, ensure you set --user-jars-first to true to prioritize your custom JARs.

If you're still experiencing the "Multiple sources found" error, you might need to try one of these alternative approaches:

  • Instead of setting --datalake-formats to an empty string, try setting it to a different data lake format that you're not using (like "delta" or "iceberg") to avoid loading the Hudi libraries.

  • If you're using AWS Glue 5.0 or later, make sure the --user-jars-first true parameter is correctly applied, as this should prioritize your custom JARs over the system ones.

  • Consider using a different AWS Glue version that might have different default behavior for handling data lake formats.

The issue you're experiencing suggests that AWS Glue might be loading the data lake format JARs by default in some configurations, regardless of the --datalake-formats setting. This behavior might vary across different AWS Glue versions.
Sources
Working with Iceberg in AWS Glue - AWS Prescriptive Guidance
Using the Delta Lake framework in AWS Glue - AWS Glue

answered 10 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.