[
https://issues.apache.org/jira/browse/DRILL-3378?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Khurram Faraaz closed DRILL-3378.
---------------------------------
Verified. Test was added here - Functional/window_functions/views/winOvrVws_37.q
> Average over window on a view returns wrong results
> ---------------------------------------------------
>
> Key: DRILL-3378
> URL: https://issues.apache.org/jira/browse/DRILL-3378
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Flow
> Affects Versions: 1.1.0
> Environment: 4 node cluster on CentOS
> Reporter: Khurram Faraaz
> Assignee: Mehant Baid
> Priority: Critical
> Labels: window_function
> Fix For: 1.1.0
>
> Attachments: DRILL-3378.patch
>
>
> We see a loss of precision for a window query over a view.
> Average aggregate query over parquet input.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> SELECT AVG(col_int) OVER() average FROM
> `forViewCrn.parquet`;
> +--------------------+
> | average |
> +--------------------+
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> | 3.033333333333333 |
> +--------------------+
> 30 rows selected (0.121 seconds)
> {code}
> The same query over a view that was created on the above parquet data. Note
> that in this case we loose the precision value after the point, which is
> incorrect.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> SELECT AVG(col_int) OVER() average FROM
> vwOnParq_wCst;
> +----------+
> | average |
> +----------+
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> +----------+
> 30 rows selected (0.165 seconds)
> {code}
> Aggregate AVG over original parquet file, with cast to INT.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> SELECT AVG(cast(col_int as INT)) OVER() average
> FROM `forViewCrn.parquet`;
> +----------+
> | average |
> +----------+
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> | 3 |
> +----------+
> 30 rows selected (0.133 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)