1

I use this SQL request in a spark context:

SELECT Max(F-Measure) FROM fMeasure_table

And I get the Exception: enter image description here

jarlh
  • 42,561
  • 8
  • 45
  • 63

1 Answers1

0

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

Community
  • 1
  • 1
himanshuIIITian
  • 5,985
  • 6
  • 50
  • 70