title: How do I register a function to sqlContext UDF in scala?
body: <p>I have a method called getAge(timestamp:Long) and I want to register this as a sql function.</p>
  
  <p>I have </p>
  
  <pre><code>sqlContext.udf.register("getAge",getAge) 
  </code></pre>
  
  <p>But its telling me I need arguments or use _ afterwards, I tried using _ but gives me error. How do I register it with an argument. I am new to scala so I have no idea how to do this.</p>