Re: [Spark SQL] ceil and floor functions on doubles

2017-05-22 Thread Vadim Semenov
Time taken: 2.041 seconds, Fetched: 1 row(s) >> >> >> >> Bests, >> >> Dongjoon. >> >> >> >> *From: *Anton Okolnychyi >> *Date: *Friday, May 19, 2017 at 7:26 AM >> *To: *"dev@spark.apache.org" >> *Subject: *[Sp

Re: [Spark SQL] ceil and floor functions on doubles

2017-05-19 Thread Anton Okolnychyi
, May 19, 2017 at 7:26 AM > *To: *"dev@spark.apache.org" > *Subject: *[Spark SQL] ceil and floor functions on doubles > > > > Hi all, > > > > I am wondering why the results of ceil and floor functions on doubles are > internally casted to longs. This causes

Re: [Spark SQL] ceil and floor functions on doubles

2017-05-19 Thread Dong Joon Hyun
017 at 7:26 AM To: "dev@spark.apache.org" Subject: [Spark SQL] ceil and floor functions on doubles Hi all, I am wondering why the results of ceil and floor functions on doubles are internally casted to longs. This causes loss of precision since doubles can hold bigger numbers.

[Spark SQL] ceil and floor functions on doubles

2017-05-19 Thread Anton Okolnychyi
Hi all, I am wondering why the results of ceil and floor functions on doubles are internally casted to longs. This causes loss of precision since doubles can hold bigger numbers. Consider the following example: // 9.223372036854786E20 is greater than Long.MaxValue val df = sc.parallelize(Array((