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

Downgrade Spark job runtime to use protobuf v2 to make maven jar work. #637

Merged
merged 2 commits into from
Sep 3, 2022

Conversation

blrchen
Copy link
Collaborator

@blrchen blrchen commented Sep 1, 2022

Description

Currently there is a conflict on protobuf-java versions between job runtime (v3.19.4) and spark runtime (v2.6.1). This will This PR does following to downgrade protobuf usage scala from v3 to v2 to resolve version conflict.

  • Regenerate java protobuf file FeatureValueOuterClass.java with v2 syntax
  • Download runtime job to take protobuf v2 as dependency
  • No changes on python client side, as v3 protobuf can decode data created with v2. This also ensures backward compatibility of python client.

On a side note, sbt assembly has a feature to shade/rename dependency, for example following code in build.sbt will rename com.google.protobuf to shade.protobuf,

  ShadeRule.rename("com.google.protobuf.**" -> "shade.protobuf.@1").inAll,

this can resolve the version conflict in fat jar, aka the blob jar published to Azure Storage. However, this can not resolve the issue for maven jar which does not contains any additional dependencies. Downgrade protobuf from v3 to v2 is still required to fix maven jar.

Resolves #616

How was this PR tested?

Following test has been done to verify latest python client can read feature data from online store that is wrotten by protobuf v2

spark-submit \
    --master local \
    --conf "spark.driver.extraClassPath=...,com.google.protobuf:protobuf-java:2.6.1
    --class com.linkedin.feathr.offline.job.FeatureGenJob \
    <feathr_root>/target/scala-2.12/feathr_2.12-0.7.2.jar \
    ...

Does this PR introduce any user-facing changes?

  • No. You can skip the rest of this section.
  • Yes. Make sure to clarify your proposed changes.

@xiaoyongzhu
Copy link
Member

Thanks Blair!

@xiaoyongzhu xiaoyongzhu merged commit 8752544 into main Sep 3, 2022
@xiaoyongzhu xiaoyongzhu deleted the blair/protobuf-v2 branch September 3, 2022 08:45
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

Successfully merging this pull request may close these issues.

[BUG] materialize_features fails with Spark error: java.lang.IllegalAccessError
3 participants