I have a Spark DataFrame query that is guaranteed to return single column with single Int value. What is the best way to extract this value as Int from the resulting DataFrame?<
This could solve your problem.
df.map{ row => row.getInt(0) }.first()