Creation of DSEGraphFrames in Java or Scala using a SparkSession

Viewed 179

I am trying to obtain a DSEGraphFrame of my DSE graphs in either java or scala. I am using the blog documentation, as follows

//load a graph in Java
DseGraphFrame graph = DseGraphFrameBuilder.dseGraph("test", spark); 


// load a graph in scala
val graph = spark.dseGraph("test_graph")

They both require a spark session (in scala is implicit). My question is how can you create the SparkSession spark? I tried already creating it by myself but the builder could not parse the master:

val spark  = SparkSession
.builder
.master("dse://<ip_address>")
.appName("DseGraphFrames")
.getOrCreate()
1 Answers
Related