Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Py4JJavaError: An error occurred while calling o226.save. : java.lang.NoClassDefFoundError: scala/Product$class #57

Open
mednourconsulting opened this issue May 28, 2021 · 2 comments

Comments

@mednourconsulting
Copy link

i am getting this error
Py4JJavaError: An error occurred while calling o226.save.
: java.lang.NoClassDefFoundError: scala/Product$class
in this step

write ratings data

ratings.write.format("es").save("ratings")
num_ratings_es = es.count(index="ratings")['count']
num_ratings_df = ratings.count()

check write went ok

print("Dataframe count: {}".format(num_ratings_df))
print("ES index count: {}".format(num_ratings_es))
plz help me

@hung96ad
Copy link

hung96ad commented Feb 9, 2022

I also got the same error

@pxike
Copy link

pxike commented Dec 17, 2023

the student despair is real, i also had this issue, luckily for me i solved it on my own , the cause of the issue is that spark 3 is compiled in scala 2.12 , and the connectors in elasticsearch are compiled in 2.11, since elasticsearch website doesn't have that in their site (for some reason like wtf ?), u can search that in maven and install it manually,
mvn dependency:get -DgroupId=org.elasticsearch -DartifactId=elasticsearch-spark-30_2.12 -Dversion=8.4.3 -Dtransitive=false
then check the local maven repo
/home/YourUserName/.m2/repository

either that or get a spark that is compiled in scala 2.11, which is spark 2.x versions but then the python version won't work cuz u will need python 3.4 or something which no longer supported , it's such a mean problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants