-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-41709][CORE][SQL][UI] Explicitly define Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
#39215
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
Conversation
Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
Codecov Report
@@ Coverage Diff @@
## master #39215 +/- ##
=======================================
Coverage 90.95% 90.95%
=======================================
Files 342 342
Lines 76706 76706
Branches 10460 10460
=======================================
Hits 69765 69765
Misses 5352 5352
Partials 1589 1589
Flags with carried forward coverage won't be shown. Click here to find out more. 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
| var physicalPlanDescription: String = null | ||
| var modifiedConfigs: Map[String, String] = _ | ||
| var metrics = Seq[SQLPlanMetric]() | ||
| var metrics = scala.collection.Seq[SQLPlanMetric]() |
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.
Just collection.Seq?
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.
done
| ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.apply"), | ||
|
|
||
| // [SPARK-41709][CORE][SQL][UI] Explicitly define Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13 | ||
| ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.spark.status.api.v1.ApplicationEnvironmentInfo.resourceProfiles"), |
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.
Need to add MimaExcludes for Scala 2.13, should we close this one
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 this is acceptable, I will make more changes, otherwise I will close this pr
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.
I think those are all internal methods right? people wouldn't call these classes in code
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.
Yes, the mima filters to be added are all internal apis
| val errorMessage = getOptional(ui.hasErrorMessage, () => ui.getErrorMessage) | ||
| val metrics = | ||
| ui.getMetricsList.asScala.map(m => SQLPlanMetricSerializer.deserialize(m)).toSeq | ||
| ui.getMetricsList.asScala.map(m => SQLPlanMetricSerializer.deserialize(m)) |
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 no toSeq, one operation is about 10ns. After adding toSeq, the delay will increase linearly with the length of the original data:
- 240ns when input length is 10
- 1740ns when input length is 100
- 16600ns when input length is 1000
Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
| ProblemFilters.exclude[DirectMissingMethodProblem]("org.apache.spark.storage.BlockManagerMessages#RegisterBlockManager.apply"), | ||
|
|
||
| // [SPARK-41709][CORE][SQL][UI] Explicitly define Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13 | ||
| ProblemFilters.exclude[IncompatibleResultTypeProblem]("org.apache.spark.status.api.v1.ApplicationEnvironmentInfo.sparkProperties"), |
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.
Scala 2.12 does not need to add these exclude filters, all changes only involve Scala 2.13.
|
Seems OK to me, un-mark it as Draft to let it test |
Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13Seq as collection.Seq to avoid toSeq when create ui objects from protobuf objects for Scala 2.13
|
Local maven test with Scala 2.13, all passed |
|
Merged to master |
|
Thanks @srowen |
What changes were proposed in this pull request?
This pr explicitly define
Seqascollection.Seqin theuirelated class definitions to avoid collection conversion when creating ui objects from protobuf objects to make no performance difference between Scala 2.13 and Scala 2.12.Why are the changes needed?
Avoid collection conversion when creating ui objects from protobuf objects for Scala 2.13.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Pass GitHub Actions