[ 
https://issues.apache.org/jira/browse/IMPALA-6503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16722479#comment-16722479
 ] 

Quanlong Huang commented on IMPALA-6503:
----------------------------------------

Actually, the two assumptions are wrong... While testing I found these:
{code}
Tuple(id=1 size=9 slots=[Slot(id=2 type=DOUBLE col_path=[2,0,2,0] offset=0 
null=(offset=8 mask=1) slot_idx=0 field_idx=-1)] tuple_path=[2, 0, 2])
Tuple(id=0 size=25 slots=[Slot(id=0 type=ARRAY col_path=[2,0,2] 
collection_item_tuple_id=1 offset=0 null=(offset=24 mask=1) slot_idx=0 
field_idx=-1), Slot(id=1 type=BIGINT col_path=[2,1] offset=16 null=(offset=24 
mask=2) slot_idx=1 field_idx=-1)] tuple_path=[2])
{code}
a. The slots in the top level tuple (id=0) have different length of col_path.
b. The top level tuple path is [2] while the col_path of its first slot is 
[2,0,2].

The table is created by Hive:
{code:sql}
hive> create table struct_array (
  id int, name string,
  structs array<struct<sid:int, sname:string, scores:array<double>>>
) stored as orc;
hive> insert into struct_array select 1, "abcdefg", array(
  named_struct("sid", 0, "sname", "inner_name1", "scores", array(0.1, 0.2, 0.3, 
0.4)),
  named_struct("sid", 1, "sname", "inner_name2", "scores", array(100, 99.9, 
98.9)),
  named_struct("sid", 2, "sname", "inner_name3", "scores", array(3.14159, 
2.71828, 0.00000001)));
{code}
And the Impala query is:
{code:sql}
[localhost:21000] default> select outer_array.pos, s.item from 
struct_array.structs outer_array, outer_array.item.scores s;                    
                                                               
{code}

> Support reading complex types from ORC format files
> ---------------------------------------------------
>
>                 Key: IMPALA-6503
>                 URL: https://issues.apache.org/jira/browse/IMPALA-6503
>             Project: IMPALA
>          Issue Type: New Feature
>          Components: Backend, Frontend
>            Reporter: Quanlong Huang
>            Assignee: Quanlong Huang
>            Priority: Major
>




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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to