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

PartitioningUpdateException #266

Merged
merged 3 commits into from
Sep 10, 2024
Merged

PartitioningUpdateException #266

merged 3 commits into from
Sep 10, 2024

Conversation

salamonpavel
Copy link
Collaborator

@salamonpavel salamonpavel commented Sep 9, 2024

Fixes sub partitions context creation.
Fixes #261

Release notes:

  • Fixes sub partitions context creation

@salamonpavel
Copy link
Collaborator Author

Release notes:

  • Fixes sub partitions context creation

Copy link

github-actions bot commented Sep 9, 2024

JaCoCo model module code coverage report - scala 2.13.11

Overall Project 63.64% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Sep 9, 2024

JaCoCo agent module code coverage report - scala 2.13.11

Overall Project 84.63% -9.17% 🍏
Files changed 8.39%

File Coverage
AtumContext.scala 92.7% -4.76%
AtumAgentException.scala 38.24% -373.53%

Copy link

github-actions bot commented Sep 9, 2024

JaCoCo reader module code coverage report - scala 2.13.11

Overall Project 100% 🍏

There is no coverage information present for the Files changed

Copy link

github-actions bot commented Sep 9, 2024

JaCoCo server module code coverage report - scala 2.13.11

Overall Project 76.47% 🍏

There is no coverage information present for the Files changed

@@ -52,7 +53,14 @@ class AtumContext private[agent] (
* @return the sub-partition context
*/
def subPartitionContext(subPartitions: AtumPartitions): AtumContext = {
agent.getOrCreateAtumSubContext(atumPartitions ++ subPartitions)(this)
val newPartitions = subPartitions.foldLeft(atumPartitions) { case (acc, (k, v)) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

Just an idea. Wouldn't intersection be clearer, what's being checked?

val overlap = atumPartitions.keys.intersect(subPartitions.keys)
if (overlap.nonEmpty) {
  throw PartitioningUpdateException(s"Partition keys '$overlap' already exist. Updates are not allowed.")
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

okok, refactored

@salamonpavel salamonpavel merged commit 18f2285 into master Sep 10, 2024
10 checks passed
@salamonpavel salamonpavel deleted the bug/261-listmap-ordering branch September 10, 2024 09:14
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.

AtumPartition.subPartitionContext orders partition keys differently in Scala 2.12 vs Scala 2.13
2 participants