You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Dongjoon Hyun (JIRA)" <ji...@apache.org> on 2016/11/10 09:48:58 UTC

[jira] [Updated] (SPARK-14664) Implement DecimalAggregates optimization for Window queries

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

Dongjoon Hyun updated SPARK-14664:
----------------------------------
    Component/s: SQL

> Implement DecimalAggregates optimization for Window queries
> -----------------------------------------------------------
>
>                 Key: SPARK-14664
>                 URL: https://issues.apache.org/jira/browse/SPARK-14664
>             Project: Spark
>          Issue Type: Bug
>          Components: Optimizer, SQL
>            Reporter: Dongjoon Hyun
>            Assignee: Dongjoon Hyun
>            Priority: Critical
>             Fix For: 2.0.0
>
>
> This issue aims to implement decimal aggregation optimization for window queries by improving existing `DecimalAggregates`. Historically, `DecimalAggregates` optimizer is designed to transform general `sum/avg(decimal)`, but it breaks recently added windows queries like the followings. The following queries work well without the current `DecimalAggregates` optimizer.
> *Sum*
> {code}
> scala> sql("select sum(a) over () from (select explode(array(1.0,2.0)) a) t").head
> java.lang.RuntimeException: Unsupported window function: MakeDecimal((sum(UnscaledValue(a#31)),mode=Complete,isDistinct=false),12,1)
> {code}
> *Average*
> {code}
> scala> sql("select avg(a) over () from (select explode(array(1.0,2.0)) a) t").head
> java.lang.RuntimeException: Unsupported window function: cast(((avg(UnscaledValue(a#40)),mode=Complete,isDistinct=false) / 10.0) as decimal(6,5))
> {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