Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1141162

Summary: Impala sorting
Product: [JBoss] JBoss Data Virtualization 6 Reporter: Filip Nguyen <fnguyen>
Component: TeiidAssignee: Van Halbert <vhalbert>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 6.1.0CC: dlesage, fnguyen, vhalbert
Target Milestone: ER4Keywords: QA-Closed
Target Release: 6.1.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
String sorting on Impala was inconsistent with that for other data sources. This has now been corrected to make it consistent.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-02-10 08:53:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Filip Nguyen 2014-09-12 11:21:38 UTC
String sorting of impala is inconsistent with our expectations:

Impala sorting
---------------------------

SELECT BQT1.SmallA.StringNum FROM BQT1.SmallA 

Results
1: -1
2: -10
3: -11
4: -12
5: -13
6: -14
7: -15
8: -16
9: -17
10: -18
11: -19
12: -2
13: -20
14: -21
15: -22
16: -24
17: -3
18: -4
19: -5
20: -6
21: -8
22: -9
23: 0
24: 1
25: 10
26: 11
27: 12
28: 13
29: 14
30: 15
31: 16
32: 17
33: 18
34: 19
35: 2
36: 20
37: 21
38: 22
39: 23
40: 24
41: 3
42: 4
43: 5
44: 6
45: 7
46: 8
47: null
48: null
49: null
50: null


Expected
---------------------------
While we expect sorting to be consistent with other sources:

1: 0
2: 1
3: -1
4: 10
5: -10
6: 11
7: -11
8: 12
9: -12
10: 13
11: -13
12: 14
13: -14
14: 15
15: -15
16: 16
17: -16
18: 17
19: -17
20: 18
21: -18
22: 19
23: -19
24: 2
25: -2
26: 20
27: -20
28: 21
29: -21
30: 22
31: -22
32: 23
33: 24
34: -24
35: 3
36: -3
37: 4
38: -4
39: 5
40: -5
41: 6
42: -6
43: 7
44: 8
45: -8
46: -9
47: null
48: null
49: null
50: null

Comment 2 Van Halbert 2014-09-17 15:17:16 UTC
That's an odd ordering. Are other types besides string affected as well? If so we can just turn off order by support.

Comment 3 Filip Nguyen 2014-09-25 09:43:42 UTC
It seems to be problem only on String columns. I tried timestamp, char, int and all sort the same as e.g. postgre translator

Comment 4 Filip Nguyen 2014-09-25 10:17:50 UTC
Correction, seems that impala puts NULLS at the end of the result. E.g. Select BQT1.SmallA.DateValue From BQT1.SmallA ORDER BY BQT1.SmallA.DateValue  DESC returns:

1: 2000-02-19
2: 2000-02-18
3: 2000-02-17
4: 2000-02-16
5: 2000-02-15
6: 2000-02-14
7: 2000-02-13
8: 2000-02-12
9: 2000-02-11
10: 2000-02-10
11: 2000-02-09
12: 2000-02-07
13: 2000-02-06
14: 2000-02-05
15: 2000-02-04
16: 2000-02-03
17: 2000-02-02
18: 2000-02-01
19: 2000-01-31
20: 2000-01-30
21: 2000-01-29
22: 2000-01-28
23: 2000-01-27
24: 2000-01-26
25: 2000-01-25
26: 2000-01-24
27: 2000-01-22
28: 2000-01-21
29: 2000-01-20
30: 2000-01-19
31: 2000-01-18
32: 2000-01-17
33: 2000-01-16
34: 2000-01-15
35: 2000-01-14
36: 2000-01-13
37: 2000-01-12
38: 2000-01-11
39: 2000-01-10
40: 2000-01-09
41: 2000-01-08
42: 2000-01-06
43: 2000-01-05
44: 2000-01-04
45: 2000-01-03
46: 2000-01-02
47: 2000-01-01
48: null
49: null
50: null

Comment 5 Filip Nguyen 2014-09-25 10:19:42 UTC
I take back the last comment. The reason nulls were at the end was because of the transformation that I use to extract the date right now before the conversion for timestamp is fixed.

FYI: convert(PARSETIMESTAMP(convert(Source.smalla.DATEVALUE, string), 'yyyy-MM-dd hh:mm:ss'), date) AS DateValue,

Comment 6 JBoss JIRA Server 2014-10-24 13:57:11 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3134 to Resolved

Comment 7 Filip Nguyen 2014-11-25 13:37:54 UTC
Commented into TEIID-3134

Comment 8 JBoss JIRA Server 2015-03-13 14:24:03 UTC
Steven Hawkins <shawkins> updated the status of jira TEIID-3134 to Closed