Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
0.7.0
-
None
Description
#Tue Nov 04 16:58:08 UTC 2014
git.commit.id.abbrev=129cb9c
String is not compared properly:
0: jdbc:drill:schema=hbase> select cast(s.row_key as varchar(20)), cast(s.onecf.name as varchar(30)) name from student s where s.row_key = '10';
----------------------+
EXPR$0 | name |
----------------------+
10 | victor nixon |
100 | bob van buren |
1000 | ulysses young |
101 | nick carson |
102 | ethan ovid |
103 | katie thompson |
104 | luke polk |
105 | ulysses davidson |
106 | bob ovid |
107 | katie robinson |
108 | sarah laertes |
109 | priscilla xylophone |
----------------------+
Here is the plan:
0: jdbc:drill:schema=hbase> explain plan for select cast(s.row_key as varchar(20)), cast(s.onecf.name as varchar(30)) name from student s where s.row_key = '10';
----------------------+
text | json |
----------------------+
00-00 Screen 00-01 Project(EXPR$0=[CAST($0):VARCHAR(20) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL], name=[CAST($1):VARCHAR(30) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary"]) 00-02 SelectionVectorRemover 00-03 Filter(condition=[=(CAST($0):CHAR(2) CHARACTER SET "ISO-8859-1" COLLATE "ISO-8859-1$en_US$primary" NOT NULL, '10')]) 00-04 Project(row_key=[$0], ITEM=[ITEM($1, 'name')]) 00-05 Scan(groupscan=[HBaseGroupScan [HBaseScanSpec=HBaseScanSpec [tableName=student, startRow=null, stopRow=null, filter=null], columns=[SchemaPath [`row_key`], SchemaPath [`onecf`.`name`]]]]) |
{ "head" : Unknown macro: { "version" }
, , Unknown macro: { "type" }
, Unknown macro: { "pop" }
, { "pop" : "filter", "@id" : 3, "child" : 4, "expr" : "equal(cast( (`row_key` ) as VARCHAR(2) ), '10') ", "initialAllocation" : 1000000, "maxAllocation" : 10000000000, "cost" : 157286.4 }, { "pop" : "selection-vector-remover", "@id" : 2, "child" : 3, "initialAllocation" : 1000000, "maxAllocation" : 10000000000, "cost" : 157286.4 }, Unknown macro: { "pop" }
, { "pop" : "screen", "@id" : 0, "child" : 1, "initialAllocation" : 1000000, "maxAllocation" : 10000000000, "cost" : 157286.4 } ] |
----------------------+
The filter item is casted as char(2):
Filter(condition=[=(CAST($0):CHAR(2)
Attachments
Issue Links
- Is contained by
-
DRILL-1631 Integer comparison in JSON
- Resolved