Re: [ML][SQL] Select UserDefinedType attribute in a DataFrame

2015-02-24 Thread Jaonary Rabarisoa
By doing so, I got the following error : Exception in thread "main" org.apache.spark.sql.AnalysisException: GetField is not valid on fields Seems that it doesn't like image.data expression. On Wed, Feb 25, 2015 at 12:37 AM, Xiangrui Meng wrote: > Btw, the correct syntax for alias should be > `

Re: [ML][SQL] Select UserDefinedType attribute in a DataFrame

2015-02-24 Thread Xiangrui Meng
Btw, the correct syntax for alias should be `df.select($"image.data".as("features"))`. On Tue, Feb 24, 2015 at 3:35 PM, Xiangrui Meng wrote: > If you make `Image` a case class, then select("image.data") should work. > > On Tue, Feb 24, 2015 at 3:06 PM, Jaonary Rabarisoa wrote: >> Hi all, >> >> I

Re: [ML][SQL] Select UserDefinedType attribute in a DataFrame

2015-02-24 Thread Xiangrui Meng
If you make `Image` a case class, then select("image.data") should work. On Tue, Feb 24, 2015 at 3:06 PM, Jaonary Rabarisoa wrote: > Hi all, > > I have a DataFrame that contains a user defined type. The type is an image > with the following attribute > > class Image(w: Int, h: Int, data: Vector)