Hi,
     I tried to create a function that to convert an Unix time stamp to the 
hour number in a day.
      It works if the code is like this:sqlContext.registerFunction("toHour", 
(x:Long)=>{new java.util.Date(x*1000).getHours})

      But, if I do it like this, it doesn't work:
      def toHour (x:Long) = {new java.util.Date(x*1000).getHours}      
sqlContext.registerFunction("toHour", toHour)
      The system reports an error:<console>:23: error: missing arguments for 
method toHour;follow this method with `_' if you want to treat it as a 
partially applied function              sqlContext.registerFunction("toHour", 
toHour)             Anyone can help on dealing with this error?

Reply via email to