Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
spark
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cs525-sp18-g07
spark
Commits
acb03230
Commit
acb03230
authored
11 years ago
by
Hossein Falaki
Browse files
Options
Downloads
Patches
Plain Diff
minor improvements
parent
d6cded71
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala
+2
-3
2 additions, 3 deletions
...rc/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala
core/src/main/scala/org/apache/spark/rdd/RDD.scala
+3
-1
3 additions, 1 deletion
core/src/main/scala/org/apache/spark/rdd/RDD.scala
with
5 additions
and
4 deletions
core/src/main/scala/org/apache/spark/rdd/PairRDDFunctions.scala
+
2
−
3
View file @
acb03230
...
...
@@ -229,9 +229,8 @@ class PairRDDFunctions[K: ClassTag, V: ClassTag](self: RDD[(K, V)])
}
val
mergeHLL
=
(
h1
:
SerializableHyperLogLog
,
h2
:
SerializableHyperLogLog
)
=>
h1
.
merge
(
h2
)
combineByKey
(
createHLL
,
mergeValueHLL
,
mergeHLL
,
partitioner
).
map
{
case
(
k
,
v
)
=>
(
k
,
v
.
value
.
cardinality
())
}
combineByKey
(
createHLL
,
mergeValueHLL
,
mergeHLL
,
partitioner
).
mapValues
(
_
.
value
.
cardinality
())
}
/**
...
...
This diff is collapsed.
Click to expand it.
core/src/main/scala/org/apache/spark/rdd/RDD.scala
+
3
−
1
View file @
acb03230
...
...
@@ -809,7 +809,9 @@ abstract class RDD[T: ClassTag](
}
def
mergeCounters
(
c1
:
SerializableHyperLogLog
,
c2
:
SerializableHyperLogLog
)
=
c1
.
merge
(
c2
)
mapPartitions
(
hllCountPartition
).
reduce
(
mergeCounters
).
value
.
cardinality
()
val
zeroCounter
=
new
SerializableHyperLogLog
(
new
HyperLogLog
(
relativeSD
))
mapPartitions
(
hllCountPartition
).
aggregate
(
zeroCounter
)(
mergeCounters
,
mergeCounters
)
.
value
.
cardinality
()
}
/**
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment