First, import the data in Spark and add IDs to it. Run these commands in scala console:
val df = spark.read.csv("file.csv")
val df1 = df.withColumn("id",monotonicallyIncreasingId)
Then use this logic to split:
val df2 = df1.filter($"id"%2!==0)
val df2 = df1.filter($"id"%2!==0)