Skip to content

Conversation

@LuciferYang
Copy link
Contributor

@LuciferYang LuciferYang commented Aug 31, 2023

What changes were proposed in this pull request?

This pr aims ignore from_protobuf messageClassName and from_protobuf messageClassName options in PlanGenerationTestSuite and remove the related golden files, after this change from_protobuf_messageClassName and from_protobuf_messageClassName_options in ProtoToParsedPlanTestSuite be ignored too.

Why are the changes needed?

SPARK-43646 | (#42236) makes both Maven and SBT use the shaded spark-protobuf module when testing the connect module, this allows mvn clean install and mvn package test to successfully pass tests. But if mvn clean test is executed directly, an error package org.sparkproject.spark_protobuf.protobuf does not exist will occur. This is because mvn clean test directly uses the classes file of the spark-protobuf module for testing, without the 'package', hence it does not shade and relocate protobuf.

On the other hand, the change of SPARK-43646 breaks the usability of importing Spark as a Maven project into IDEA(#42236 (comment)).

So #42746 revert the change of SPARK-43646.

It's difficult to find a perfect solution to solve this maven test issues now, as in certain scenarios tests would use the shaded spark-protobuf jar, like mvn package test, while in some other scenarios it will use the unshaded classes directory, such as mvn clean test. so this pr ignores the relevant tests first and leaves a TODO(SPARK-45030), to re-enable these tests when we find a better solution.

Does this PR introduce any user-facing change?

No

How was this patch tested?

Pass Github Actions

Was this patch authored or co-authored using generative AI tooling?

No

@LuciferYang
Copy link
Contributor Author

LuciferYang commented Aug 31, 2023

Copy link

@rangadi rangadi left a comment

Choose a reason for hiding this comment

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

Thank you @LuciferYang for looking into these very tricky issues (and for explaining in the PRs).
Disabling sounds good to me. Shaded java classes is not used much even in the field because of these complexities.

LuciferYang added a commit that referenced this pull request Sep 1, 2023
…from_protobuf messageClassName options` in `PlanGenerationTestSuite`

### What changes were proposed in this pull request?
This pr aims ignore `from_protobuf messageClassName` and `from_protobuf messageClassName options` in `PlanGenerationTestSuite` and remove the related golden files, after this change `from_protobuf_messageClassName` and `from_protobuf_messageClassName_options` in `ProtoToParsedPlanTestSuite` be ignored too.

### Why are the changes needed?
SPARK-43646 | (#42236) makes both Maven and SBT use the shaded `spark-protobuf` module when testing the connect module, this allows `mvn clean install` and `mvn package test` to successfully pass tests. But if `mvn clean test` is executed directly, an error `package org.sparkproject.spark_protobuf.protobuf does not exist` will occur. This is because `mvn clean test` directly uses the classes file of the `spark-protobuf` module for testing, without the 'package', hence it does not `shade` and `relocate` protobuf.

On the other hand, the change of SPARK-43646 breaks the usability of importing Spark as a Maven project into IDEA(#42236 (comment)).

So #42746 revert the change of [SPARK-43646](https://issues.apache.org/jira/browse/SPARK-43646).

It's difficult to find a perfect solution to solve this maven test issues now, as in certain scenarios tests would use the `shaded spark-protobuf jar`, like `mvn package test`, while in some other scenarios it will use the `unshaded classes directory`, such as `mvn clean test`. so this pr ignores the relevant tests first and leaves a TODO(SPARK-45030), to re-enable these tests when we find a better solution.

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
Pass Github Actions

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #42751 from LuciferYang/SPARK-45029.

Authored-by: yangjie01 <[email protected]>
Signed-off-by: yangjie01 <[email protected]>
(cherry picked from commit 10f3190)
Signed-off-by: yangjie01 <[email protected]>
@LuciferYang
Copy link
Contributor Author

Merged into master and branch-3.5.Thanks @rangadi

Copy link
Member

@HyukjinKwon HyukjinKwon left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants