You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Alexander Malashevsky (JIRA)" <ji...@apache.org> on 2018/01/30 17:53:00 UTC

[jira] [Created] (DRILL-6122) Order by clause works inconsistently when sorting columns with NaN

Alexander Malashevsky created DRILL-6122:
--------------------------------------------

             Summary: Order by clause works inconsistently when sorting columns with NaN
                 Key: DRILL-6122
                 URL: https://issues.apache.org/jira/browse/DRILL-6122
             Project: Apache Drill
          Issue Type: Bug
          Components: Storage - JSON
    Affects Versions: 1.13.0
            Reporter: Alexander Malashevsky
            Assignee: Volodymyr Tkach
         Attachments: orderBy.json, orderByIssue.jpg

*AFFECTED_VERSION:* drill-1.13.0-SNAPSHOT

*AFFECTED_FUNCTIONALITY:* ORDER BY, DESC

*ISSUE_DESCRIPTION:* 'ORDER BY/DESC' clause behaves in different ways when sorting columns containing NaN values. In one case it considers NaN to be the largest value, in another - the smallest one. 
*Steps:*
- Select from the attached test file (orderBy.json, attached)
	{code}SELECT name, attr4 from dfs.tmp.`orderBy.json` order by name, attr4{code}
- Check the attached screen shot (orderByIssue.jpg):
	*EXPECTED_RESULT:* It was expected the 'ORDER BY' clause to sort attr4 columns data in the same way (most probably NaN should be the largest, see *NB*)
	*ACTUAL_RESULT:* attr4 column's values were sorted in different ways: for 'obj1'/'obj3' NaN is the largest, for 'obj2'/'obj4' NaN is the smallest.

*NB:* Postgres as well as Java's sorting (Collection.sort() / Arrays.sort() methods) treats NaN as the largest value



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)