Spark GraphFrames are introduced in Spark 3.0 version to support Graphs on DataFrames. Prior to 3.0, Spark had GraphX library which ideally runs on RDD, and lost all Data Frame capabilities.
GraphFrames is a graph processing library for Apache Spark that provides high-level abstractions for working with graphs and performing graph analytics. It extends Spark’s DataFrame API to support graph operations, allowing users to express complex graph queries using familiar DataFrame operations.
// Import necessary libraries
import org.apache.spark.sql.SparkSession
import org.graphframes.GraphFrame
// Create a Spark session
val spark = SparkSession.builder.appName("GraphFramesExample").getOrCreate()