i writing this basic condition for age group
def age (x:Int):Int = {(if x> 18) x else 0}
in spark shell
but getting below error message ::
:1: error: ‘(’ expected but identifier found.
def age (x:Int):Int = {(if x> 18) x else 0}
^
:1: error: illegal start of simple expression
def age (x:Int):Int = {(if x> 18) x else 0}
Can anyone please help me
Thanks in adv