hive-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Krisztian Kasa (Jira)" <j...@apache.org>
Subject [jira] [Commented] (HIVE-22622) Hive allows to create a struct with duplicate attribute names
Date Fri, 28 Aug 2020 09:33:00 GMT

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

Krisztian Kasa commented on HIVE-22622:
---------------------------------------

[~jcamachorodriguez]
It seems that this was fixed already because I was not able to repro: 
{code}
create table test_struct( duplicateColumn struct<id:int, id:int>);

insert into test_struct select named_struct("id",1,"id",2);

select * from test_struct;
{"id":1,"id":2}

select duplicateColumn.id from test_struct;
1
{code}

Should the field name uniqueness checked when creating the table anyway? Since only one of
the fields can be queried directly.

> Hive allows to create a struct with duplicate attribute names
> -------------------------------------------------------------
>
>                 Key: HIVE-22622
>                 URL: https://issues.apache.org/jira/browse/HIVE-22622
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Denys Kuzmenko
>            Assignee: Krisztian Kasa
>            Priority: Major
>
> When you create at table with a struct with twice the same attribute name, hive allow
you to create it.
> create table test_struct( duplicateColumn struct<id:int, id:int>);
> You can insert data into it :
> insert into test_struct select named_struct("id",1,"id",1);
> But you can not read it :
> select * from test_struct;
> Return : java.io.IOException: java.io.IOException: Error reading file: hdfs://.../test_struct/delta_0000001_0000001_0000/bucket_00000
,
> We can create and insert. but fail on read the Struct part of the tables. We can still
read all other columns (if we have more than one) but not the struct anymore.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message