title: Creating User Defined Function in Spark-SQL
body: <p>I am new to spark and spark sql and i was trying to query some data using spark SQL.</p>
  <p>I need to fetch the month from a date which is given as a string.</p>
  <p>I think it is not possible to query month directly from sparkqsl so i was thinking of writing a user defined function in scala.</p>
  <p>Is it possible to write udf in sparkSQL and if possible can anybody suggest the best method of writing an udf.</p>