Skip to content

Commit 40b632a

Browse files
committed
swap RID to myid
1 parent f4cf285 commit 40b632a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

spark/files/reduceByKey.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import org.joda.time.DateTime
1111
/*
1212
For example, if you have 4 documents of :
1313
14-
{ "doc": "A", "timestamp" : ISODate("2016-02-15T00:43:04.686Z"), "RID" : 1 }
15-
{ "doc": "B", "timestamp" : ISODate("2016-02-15T00:43:06.310Z"), "RID" : 2 }
16-
{ "doc": "C", "timestamp" : ISODate("2016-01-03T00:43:07.534Z"), "RID" : 1 }
17-
{ "doc": "D", "timestamp" : ISODate("2016-01-03T00:43:09.214Z"), "RID" : 2 }
14+
{ "doc": "A", "timestamp" : ISODate("2016-02-15T00:43:04.686Z"), "myid" : 1 }
15+
{ "doc": "B", "timestamp" : ISODate("2016-02-15T00:43:06.310Z"), "myid" : 2 }
16+
{ "doc": "C", "timestamp" : ISODate("2016-01-03T00:43:07.534Z"), "myid" : 1 }
17+
{ "doc": "D", "timestamp" : ISODate("2016-01-03T00:43:09.214Z"), "myid" : 2 }
1818
1919
Grouping by `myid` sort latest timestamp, would return only two documents, doc:A and doc:B.
2020
Removing duplicates of myid’s by returning only documents with the latest timestamp.

0 commit comments

Comments
 (0)