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

Feature/350 fix tests #351

Merged
merged 6 commits into from
Jan 27, 2024
Merged

Feature/350 fix tests #351

merged 6 commits into from
Jan 27, 2024

Conversation

kevinwallimann
Copy link
Collaborator

Closes #350

Copy link

github-actions bot commented Jan 24, 2024

JaCoCo code coverage report

There is no coverage information present for the Files changed

Total Project Coverage 83.54% 🍏

@kevinwallimann kevinwallimann marked this pull request as ready for review January 25, 2024 15:15
Comment on lines -162 to -169
<!-- Avro -->
<dependency>
<groupId>org.apache.avro</groupId>
<artifactId>avro</artifactId>
<version>${avro.version}</version>
<scope>provided</scope>
</dependency>

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the dependency is not declared, where is the Avro coming from? Confluent or Spark?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's coming from Spark. But I realize that it's basically luck, I didn't think of confluent.

The reason why I removed it is because in principle we should compile against the Avro version that Spark sets, because Avro is packaged with the Spark runtime.

We could just set the Avro version for each Spark version, but we also need to set the version for jackson-core, because Spark does actually override it. E.g. Avro 1.11.2 depends on jackson-core 2.14.2, but Spark 3.5.0 overrides this and uses jackson-core 2.15.2

Another, perhaps radical approach would be to import the pom of spark-parent, and thereby its dependencyManagement section (https://github.com/apache/spark/blob/master/pom.xml#L434-L2857). Then we would be sure that we always use the same dependencies as Spark does. However, unfortunately it's overly intrusive since it defines not only the runtime dependencies, but also test dependencies like scalatest, scalacheck etc.

So for now, I think the better solution is to just define the versions of avro and jackson-core along with the spark version in the respective profiles

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another, perhaps radical approach would be to import the pom of spark-parent

I did this for spline agent, but we have separated pom for the uber-jar creation there if I remember correctly.

But I agree, this is a good solution.

<spark.version>${spark-35.version}</spark.version>
<confluent.version>6.2.1</confluent.version>
</properties>
</profile>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confluent.version seems to be the same everywhere.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I guess we can set it as a constant then. If we want to make it dynamic it in the future, we can always change it

Copy link
Collaborator

@cerveada cerveada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just read the code

@kevinwallimann kevinwallimann merged commit fda9b4f into master Jan 27, 2024
11 checks passed
@kevinwallimann kevinwallimann deleted the feature/350-fix-tests branch January 27, 2024 11:57
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.

Fix tests for Spark 3.5.0
2 participants