No, because these are different values defined differently. If you have 1 data point, the sample stdev is undefined while population stdev is defined. Refer to their definition.
On Thu, Jul 7, 2016 at 9:23 AM, Mungeol Heo <mungeol....@gmail.com> wrote: > Hello, > > As I mentioned at the title, stddev_samp function gives a NaN while > stddev_pop gives a numeric value on the same data. > The stddev_samp function will give a numeric value, if I cast it to decimal. > E.g. cast(stddev_samp(column_name) as decimal(16,3)) > Is it a bug? > > Thanks > > - mungeol > > --------------------------------------------------------------------- > To unsubscribe e-mail: user-unsubscr...@spark.apache.org > --------------------------------------------------------------------- To unsubscribe e-mail: user-unsubscr...@spark.apache.org