Re: how to call udf with parameters

2017-06-18 Thread Yong Zhang
ataset.select(len($"text").as('length)).show +--+ |length| +--+ | true| | true| +--+ Yong From: Pralabh Kumar <pralabhku...@gmail.com> Sent: Friday, June 16, 2017 12:19 AM To: lk_spark Cc: user.spark Subject: Re: how to call udf with param

Re: Re: Re: how to call udf with parameters

2017-06-15 Thread lk_spark
thanks Kumar , that really helpful !! 2017-06-16 lk_spark 发件人:Pralabh Kumar <pralabhku...@gmail.com> 发送时间:2017-06-16 18:30 主题:Re: Re: how to call udf with parameters 收件人:"lk_spark"<lk_sp...@163.com> 抄送:"user.spark"<user@spark.apache.org> val

Re: Re: how to call udf with parameters

2017-06-15 Thread Pralabh Kumar
th errors. Does the udf parameters could only >> be a column type? >> >> 2017-06-16 >> -- >> lk_spark >> ------ >> >> *发件人:*Pralabh Kumar <pralabhku...@gmail.com> >> *发送时间:*2017-06-16 17:49

Re: Re: how to call udf with parameters

2017-06-15 Thread Pralabh Kumar
t; and end index ? I try it with errors. Does the udf parameters could only > be a column type? > > 2017-06-16 > -- > lk_spark > -- > > *发件人:*Pralabh Kumar <pralabhku...@gmail.com> > *发送时间:*2017-06-16 17:49 &g

Re: Re: how to call udf with parameters

2017-06-15 Thread lk_spark
hku...@gmail.com> 发送时间:2017-06-16 17:49 主题:Re: how to call udf with parameters 收件人:"lk_spark"<lk_sp...@163.com> 抄送:"user.spark"<user@spark.apache.org> sample UDF val getlength=udf((data:String)=>data.length()) data.select(getlength(data("col1")))

Re: how to call udf with parameters

2017-06-15 Thread Pralabh Kumar
sample UDF val getlength=udf((data:String)=>data.length()) data.select(getlength(data("col1"))) On Fri, Jun 16, 2017 at 9:21 AM, lk_spark wrote: > hi,all > I define a udf with multiple parameters ,but I don't know how to > call it with DataFrame > > UDF: > > def ssplit2

how to call udf with parameters

2017-06-15 Thread lk_spark
hi,all I define a udf with multiple parameters ,but I don't know how to call it with DataFrame UDF: def ssplit2 = udf { (sentence: String, delNum: Boolean, delEn: Boolean, minTermLen: Int) => val terms = HanLP.segment(sentence).asScala . Call : scala> val output =