I use this SQL request in a spark context:
SELECT Max(F-Measure) FROM fMeasure_table
I use this SQL request in a spark context:
SELECT Max(F-Measure) FROM fMeasure_table
To select a column with hyphen -
in Apache Spark use following syntax:
For Apache Spark 1.x or below:
sqlContext.sql("select max(`F-Measure`) from fMeasure_table")
For Apache Spark 2.x or above:
spark.sql("select max(`F-Measure`) from fMeasure_table")
Here is the link for a similar question: How to escape column names with hyphen in Spark SQL