[
https://issues.apache.org/jira/browse/DRILL-4061?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15000986#comment-15000986
]
Khurram Faraaz commented on DRILL-4061:
---------------------------------------
Different vendors follow different implementations, mySQL returns floating
point value when two integers are divided. Postgres returns integer value when
two integers are divided, so does Drill.
SQL standard ISO 9075 states that, The precision and scale of the result of
division are implementation-defined.
Marking this issue as Not a problem.
> Incorrect results returned by window function query.
> ----------------------------------------------------
>
> Key: DRILL-4061
> URL: https://issues.apache.org/jira/browse/DRILL-4061
> Project: Apache Drill
> Issue Type: Bug
> Components: Execution - Flow
> Affects Versions: 1.3.0
> Environment: 4 node cluster CentOS
> Reporter: Khurram Faraaz
> Attachments: 0_0_0.parquet
>
>
> Window function query that uses lag function returns incorrect results.
> sys.version => 3a73f098
> Drill 1.3
> Test parquet file is attached here.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> CREATE TABLE testrepro AS SELECT
> CAST(columns[0] AS INT) col0, CAST(columns[1] AS INT) col1 FROM
> `testRepro.csv`;
> +-----------+----------------------------+
> | Fragment | Number of records written |
> +-----------+----------------------------+
> | 0_0 | 11 |
> +-----------+----------------------------+
> 1 row selected (0.542 seconds)
> 0: jdbc:drill:schema=dfs.tmp> select col1, 1 / (col1 - lag(col1) OVER (ORDER
> BY col0)) from testrepro;
> +-------+---------+
> | col1 | EXPR$1 |
> +-------+---------+
> | 11 | null |
> | 9 | 0 |
> | 0 | 0 |
> | 10 | 0 |
> | 19 | 0 |
> | 13 | 0 |
> | 17 | 0 |
> | -1 | 0 |
> | 1 | 0 |
> | 20 | 0 |
> | 100 | 0 |
> +-------+---------+
> 11 rows selected (0.451 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)