Details
-
Bug
-
Status: Open
-
Critical
-
Resolution: Unresolved
-
1.9.0
-
None
-
None
-
4 node cluster CentOS
Description
select over array of maps returns incorrect results
Drill 1.9.0 git commit ID : 28d315bbb
Data used in test
[test@centos-a ~]# cat arrayofmaps.json {"arr":[{"key":"a"},{"key":"b"},{"key":"c"},{"key":"d"}]}
Array elements are
0: jdbc:drill:schema=dfs.tmp> select t.arr from `arrayofmaps.json` t; +----------------------------------------------------+ | arr | +----------------------------------------------------+ | [{"key":"a"},{"key":"b"},{"key":"c"},{"key":"d"}] | +----------------------------------------------------+ 1 row selected (0.289 seconds)
The below query should return 4 rows, each row containing one value a,b,c and d respectively
However query just returns only one value, which is not correct.
0: jdbc:drill:schema=dfs.tmp> select t.arr.key from `arrayofmaps.json` t where t.arr.key is not null; +---------+ | EXPR$0 | +---------+ | a | +---------+ 1 row selected (0.33 seconds)
Explain plan for above failing query
0: jdbc:drill:schema=dfs.tmp> explain plan for select t.arr.key from `arrayofmaps.json` t where t.arr.key is not null; +------+------+ | text | json | +------+------+ | 00-00 Screen 00-01 Project(EXPR$0=[$0]) 00-02 SelectionVectorRemover 00-03 Filter(condition=[IS NOT NULL($0)]) 00-04 Project(ITEM=[ITEM($0, 'key')]) 00-05 Scan(groupscan=[EasyGroupScan [selectionRoot=maprfs:/tmp/arrayofmaps.json, numFiles=1, columns=[`arr`.`key`], files=[maprfs:///tmp/arrayofmaps.json]]])