I have a SparkSession handle, which I use to create a dataframe, in my main function in Java.
SparkSession sparkSession = SparkSession.builder.getOrCreate(); Data