I am currently new to .NET for Spark and need to append a C# list to a delta table. I assume I first need to create a Spark DataFrame to do this. In the sample code how would I go about appending "names" to the dataframe "df"?
It seems now this has been deprecated (https://github.com/Microsoft/Mobius) that using RDD's is not available with the new version (https://github.com/dotnet/spark)
using System.Collections.Generic;
using Microsoft.Spark.Sql;
namespace HelloSpark
{
class Program
{
static void Main(string[] args)
{
var spark = SparkSession.Builder().GetOrCreate();
var df = spark.Read().Json("people.json");
df.Show();
var names = new List<string> { "john", "20" };
}
}
}
The example file people.json looks like the following:
{"name":"Michael"}
{"name":"Andy", "age":"30"}
{"name":"Justin", "age":"19"}