thanks much Michael let me try.=C2=A0

On Sat, Oct 10, 2015 at 1:20 AM,= Michael Armbrust wrote:
This is confusing because I m= ade a typo...

callUDF("percentile_appr= ox",=C2=A0col(&= quot;mycol"), lit(0.25))

The first argument is the name of the UDF, all other argumen= ts need to be columns that are passed in as arguments. =C2=A0lit is just sa= ying to make a literal column that always has the value 0.25.
<= /div>
On Fri, Oct 9, 2015 at 12:16 PM, wrote:

Yes but I mean, this is r= ather curious. How is def lit(literal:Any) --> becomes a percentile func= tion lit(25)

=C2=A0

Thanks for clarification<= u>

Saif=

=C2=A0

From: Umesh Ka= cha [mailto:umes= h.kacha@gmail.com]
Sent: Friday, October 09, 2015 4:10 PM
To: Ellafi, Saif A.
Cc: Michael Armbrust; user

Subject: Re: How to calculate percentile of a column of DataFrame?

=C2=A0

I found it in 1.3 documentation lit says something e= lse not percent

=C2=A0

```public static=C2=A0Column=C2=A0lit(Obj=
ect=C2=A0literal)```

Creates a=C2=A0`Column````=C2=A0of literal value.```

``` The passed in object is returned directly if it = is already a=C2=A0Column. If the object is a Scala Symbol, it is converted into a=C2=A0Column=C2=A0also. Otherwise, a new=C2=A0Column=C2=A0is created to represent the literal value. ```
``` ```
``` ```
``` =C2=A0 On Sat, Oct 10, 2015 at 12:39 AM, <Saif.A.Ellafi@wellsfarg= o.com> wrote: Where can we find other a= vailable functions such as lit() ? I can=E2=80=99t find lit in the api. =C2=A0 Thanks =C2=A0 From: Michael = Armbrust [mailto:michael@databricks.com] Sent: Friday, October 09, 2015 4:04 PM To: unk1102 Cc: user Subject: Re: How to calculate percentile of a column of DataFrame? =C2=A0 You can use callU= DF(col("mycol"), lit(0.25)) to call hive UDFs from datafra= mes. =C2=A0 On Fri, Oct 9, 2015 at 12:01 PM, unk1102 <umesh.kacha@gmail.com> wrote: Hi how to calculate p= ercentile of a column in a DataFrame? I cant find any percentile_approx function in Spark aggregation functions. For e.g. in Hive= we have percentile_approx and we can use it in the following way hiveContext.sql("select percentile_approx("mycol",0.25) from= myTable); I can see ntile function but not sure how it is gonna give results same as<= br> above query please guide. -- View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/How-to-calculate-percen= tile-of-a-column-of-DataFrame-tp25000.html Sent from the Apache Spark User List mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@spark.apache.org For additional commands, e-mail: user-help@spark.apache.org =C2=A0 =C2=A0 ```
``` ```
``` ```

``` ```

``` --089e0112cb563855b70521b16b54-- ```