You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Tristan (JIRA)" <ji...@apache.org> on 2015/12/28 18:10:49 UTC

[jira] [Updated] (SPARK-12491) UDAF result differs in SQL if alias is used

     [ https://issues.apache.org/jira/browse/SPARK-12491?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tristan updated SPARK-12491:
----------------------------
    Description: 
Using the GeometricMean UDAF example (https://databricks.com/blog/2015/09/16/spark-1-5-dataframe-api-highlights-datetimestring-handling-time-intervals-and-udafs.html), I found the following discrepancy in results:

{code}
scala> sqlContext.sql("select group_id, gm(id) from simple group by group_id").show()
+--------+---+
|group_id|_c1|
+--------+---+
|       0|0.0|
|       1|0.0|
|       2|0.0|
+--------+---+


scala> sqlContext.sql("select group_id, gm(id) as GeometricMean from simple group by group_id").show()
+--------+-----------------+
|group_id|    GeometricMean|
+--------+-----------------+
|       0|8.981385496571725|
|       1|7.301716979342118|
|       2|7.706253151292568|
+--------+-----------------+
{code}

  was:
Using the GeometricMean UDAF example (https://databricks.com/blog/2015/09/16/spark-1-5-dataframe-api-highlights-datetimestring-handling-time-intervals-and-udafs.html), I found the following discrepancy in results:

scala> sqlContext.sql("select group_id, gm(id) from simple group by group_id").show()
+--------+---+
|group_id|_c1|
+--------+---+
|       0|0.0|
|       1|0.0|
|       2|0.0|
+--------+---+


scala> sqlContext.sql("select group_id, gm(id) as GeometricMean from simple group by group_id").show()
+--------+-----------------+
|group_id|    GeometricMean|
+--------+-----------------+
|       0|8.981385496571725|
|       1|7.301716979342118|
|       2|7.706253151292568|
+--------+-----------------+


> UDAF result differs in SQL if alias is used
> -------------------------------------------
>
>                 Key: SPARK-12491
>                 URL: https://issues.apache.org/jira/browse/SPARK-12491
>             Project: Spark
>          Issue Type: Bug
>          Components: SQL
>    Affects Versions: 1.5.2
>            Reporter: Tristan
>
> Using the GeometricMean UDAF example (https://databricks.com/blog/2015/09/16/spark-1-5-dataframe-api-highlights-datetimestring-handling-time-intervals-and-udafs.html), I found the following discrepancy in results:
> {code}
> scala> sqlContext.sql("select group_id, gm(id) from simple group by group_id").show()
> +--------+---+
> |group_id|_c1|
> +--------+---+
> |       0|0.0|
> |       1|0.0|
> |       2|0.0|
> +--------+---+
> scala> sqlContext.sql("select group_id, gm(id) as GeometricMean from simple group by group_id").show()
> +--------+-----------------+
> |group_id|    GeometricMean|
> +--------+-----------------+
> |       0|8.981385496571725|
> |       1|7.301716979342118|
> |       2|7.706253151292568|
> +--------+-----------------+
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org