-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-43646][CONNECT][TESTS] Make both SBT and Maven use spark-proto uber jar to test the connect module
#42236
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
Changes from 8 commits
bd88c72
55c975a
93d64dd
eaa01e5
d9411f9
dc13f71
ac92862
113251b
2563eb4
8ac1c79
9e0333d
4ba45e0
f14b9ab
db17e5b
5b7f230
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3233,14 +3233,15 @@ class PlanGenerationTestSuite | |
| "connect/common/src/test/resources/protobuf-tests/common.desc" | ||
|
|
||
| test("from_protobuf messageClassName") { | ||
| binary.select(pbFn.from_protobuf(fn.col("bytes"), classOf[StorageLevel].getName)) | ||
| binary.select( | ||
| pbFn.from_protobuf(fn.col("bytes"), "org.apache.spark.sql.protobuf.protos.TestProtoObj")) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Moving the discussion about "why do users need to shade their java classes?" here in a comment thread. cc: @LuciferYang, @advancedxy, @HyukjinKwon. There is no other option. Spark at runtime includes unshaded Protobuf library (2.5.x) in its class path. This is was as of a few months back. Don't know if that changed. Its been this way for years. There is no way to support protobuf Java classes for current versions of Protobuf library without shading. I agree it is not convenient for the customers. That is why descriptor file is documented as the primary API (both for Scala and python).
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After #41153, protobuf 2.5 is no longer in classpath :)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rangadi I'm sorry that I neglected the historical context of adding these functions. Spark 3.5 no longer depends on Protobuf 2.5, and these functions are currently marked as There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That requires removing shading of protobuf classes. It needs more discussion. In general, including non-shaded jars is problematic (that is how original protobuf 2.5 version jar remained unchanged for many years).
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Yeah, I noticed there's protobu-2.5 jar in the spark-3.4 client tar. For Spark 3.5, do you think it's better to publishing both shading and unshaded version of spark-protobuf jar? If both published, end customers could choose which jar to use and we can documented it clearly. |
||
| } | ||
|
|
||
| test("from_protobuf messageClassName options") { | ||
| binary.select( | ||
| pbFn.from_protobuf( | ||
| fn.col("bytes"), | ||
| classOf[StorageLevel].getName, | ||
| "org.apache.spark.sql.protobuf.protos.TestProtoObj", | ||
| Map("recursive.fields.max.depth" -> "2").asJava)) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Project [from_protobuf(bytes#0, org.apache.spark.connect.proto.StorageLevel, None) AS from_protobuf(bytes)#0] | ||
| Project [from_protobuf(bytes#0, org.apache.spark.sql.protobuf.protos.TestProtoObj, None) AS from_protobuf(bytes)#0] | ||
| +- LocalRelation <empty>, [id#0L, bytes#0] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| Project [from_protobuf(bytes#0, org.apache.spark.connect.proto.StorageLevel, None, (recursive.fields.max.depth,2)) AS from_protobuf(bytes)#0] | ||
| Project [from_protobuf(bytes#0, org.apache.spark.sql.protobuf.protos.TestProtoObj, None, (recursive.fields.max.depth,2)) AS from_protobuf(bytes)#0] | ||
| +- LocalRelation <empty>, [id#0L, bytes#0] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we deem this plan too intricate, we could delete or ignore test cases
from_protobuf messageClassNameandfrom_protobuf messageClassName optionsto temporarily abandon this testing scenarioThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great! Thank you.