I'm using the following annotation parameter shipped with Spark-SQL:
@SQLUserDefinedType(udt = ActionUDT.CLAZZ)
trait Action extends ActionLike {
...implementation
}
Where ActionUDT.CLAZZ
is defined as a constant val:
object ActionUDT extends ActionUDT {
final val CLAZZ: Class[_ <: ActionUDT] = this.getClass
}
But I got the following compiler error:
Error:(25, 37) annotation argument needs to be a constant; found: ActionUDT.clazz
@SQLUserDefinedType(udt = ActionUDT.clazz)
^
Why does it produce such a false alarm? Is it a bug? I'm using Scala 2.10.5