Hi all,

I am unable to register a UDF with return type as StructType:

scala> def test(r:StructType):StructType = { r }
>
> test: (r:
>> org.apache.spark.sql.types.StructType)org.apache.spark.sql.types.StructType
>
>
>> scala> sqlContext.udf.register("test",test _ )
>
> scala.MatchError: org.apache.spark.sql.types.StructType (of class
>> scala.reflect.internal.Types$TypeRef$$anon$6)
>
> at
>> org.apache.spark.sql.catalyst.ScalaReflection$class.schemaFor(ScalaReflection.scala:101)
>
> at
>> org.apache.spark.sql.catalyst.ScalaReflection$.schemaFor(ScalaReflection.scala:29)
>
> at
>> org.apache.spark.sql.catalyst.ScalaReflection$class.schemaFor(ScalaReflection.scala:64)
>
>
Can someone throw some light on this ? and Is there any work around for it
?

TIA.

Regards,
Rishabh.

Reply via email to