Use the identifier clause (more like a function) in Spark SQL. It requires runtime 13.3 LTS or higher.