How to set spark.driver.extraLibraryPath in EMR Serverless

0

Hello, i tried run JNI code which uses the file as a dependency libMylibName.so. Before(not in EMR Serverless) i can use it just specify --conf spark.driver.extraLibraryPath=/path_to_my_lib and --conf spark.executor.extraLibraryPath=/path_to_my_lib , but this options not supported in Serverless following here documentation i found similar answer for python, but it not suit for me post, because i use Scala

Error which i got if not specify spark.driver.extraLibraryPath and spark.executor.extraLibraryPath= Exception in thread "main" java.lang.UnsatisfiedLinkError: no MylibName in java.library.path

Question: how i can specify this dependency for my spark application?

FYI: --conf spark.driver.extraJavaOptions="-Djava.library.path=s3://path_to_libs" also not work correct it changed java.library.path Variable but i continue got UnsatisfiedLinkError Enter image description here

asked a year ago998 views
1 Answer
1

I found the solution on my own and publish it here:

--conf spark.archives=s3://path_to_file/my_libs_so.tar.gz#my_libs --conf spark.executor.extraJavaOptions="-Djava.library.path=/home/hadoop/my_libs" --conf spark.driver.extraJavaOptions="-Djava.library.path=/home/hadoop/my_libs"

Archive my_libs_so.tar.gz should contains all your the necessary *.so files

answered a year ago
AWS
EXPERT
reviewed a year 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.

Guidelines for Answering Questions