Skip to content

Commit

Permalink
updating failing sample #2
Browse files Browse the repository at this point in the history
  • Loading branch information
skaarthik committed Dec 17, 2015
1 parent af4043e commit 0d4dab5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions csharp/Samples/Microsoft.Spark.CSharp/DataFrameSamples.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,17 @@ internal static void DFRddSample()

var dfCount = peopleDataFrame.Count();
var peopleRdd = peopleDataFrame.Rdd;
var stringrdd = peopleRdd.Map(x => string.Format("{0}, {1}", x.Size(), x.ToString()));
Console.WriteLine("count of stringrdd is " + stringrdd.Count());
var stringrddvalues = stringrdd.Collect();
int i = 1;
foreach (var stringrddvalue in stringrddvalues)
{
Console.WriteLine("{0}: {1}", i++, stringrddvalue);
}

var rdd = peopleRdd.Map(x => 1);
Console.WriteLine("count of rdd is " + rdd.Count());
var sum = rdd.Fold(0, (x, y) => x + y);
Console.WriteLine("Sum is " + sum);
var peopleRddCount = peopleRdd.Count();
Expand Down

0 comments on commit 0d4dab5

Please sign in to comment.