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)

Reply via email to