I think we made a mistake and forgot to register the function in the registry: https://github.com/apache/spark/blob/master/sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/FunctionRegistry.scala
Do you mind submitting a pull request to fix this? Should be an one line change. I filed a ticket to track this: https://issues.apache.org/jira/browse/SPARK-11233 On Wed, Oct 21, 2015 at 2:30 AM, Shagun Sodhani <sshagunsodh...@gmail.com> wrote: > Hi! I was trying out different arithmetic functions in SparkSql. I noticed > a weird thing. While *sinh* and *tanh* functions are working, using *cosh* > results > in an error saying: > > *Exception in thread "main" org.apache.spark.sql.AnalysisException: > undefined function cosh;* > > The documentation says *cosh* is implemented since 1.4 and I also find it > weird that since *tanh* and *sinh* are implemented (and working) why > would *cosh* fail. I looked for it on jira but could not find any related > bug. Could someone confirm if this is an actual issue or something wrong on > my part. > > Query I am using: SELECT cosh(`age`) as `data` FROM `table` > Spark Version: 10.4 > SparkSql Version: 1.5.1 > > I am using the standard example of (name, age) schema (though I am setting > age as Double and not Int as I am trying out maths functions). > > The entire error stack can be found here <http://pastebin.com/Tc7BQkCm>. > > Thanks! > > Shagun >