Re: Inferring schema from GenericRowWithSchema

2016-05-17 Thread Andy Grove
Hmm. I see. Yes, I guess that won't work then. I don't understand what you are proposing about UDFRegistration. I only see methods that take tuples of various sizes (1 .. 22). On Tue, May 17, 2016 at 1:00 PM, Michael Armbrust wrote: > I don't think that you will be able

Re: Inferring schema from GenericRowWithSchema

2016-05-17 Thread Michael Armbrust
I don't think that you will be able to do that. ScalaReflection is based on the TypeTag of the object, and thus the schema of any particular object won't be available to it. Instead I think you want to use the register functions in UDFRegistration that take a schema. Does that make sense? On

Inferring schema from GenericRowWithSchema

2016-05-17 Thread Andy Grove
Hi, I have a requirement to create types dynamically in Spark and then instantiate those types from Spark SQL via a UDF. I tried doing the following: val addressType = StructType(List( new StructField("state", DataTypes.StringType), new StructField("zipcode", DataTypes.IntegerType) ))