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

Alexander Pivovarov commented on HIVE-3044:
-------------------------------------------

"index" UDF working fine for me in hive-0.13.1
{code}
select index(array(1, 2, 3), 2) from dual;
OK
3
{code}
BTW, we can use array\[n\] or map\[key\] to get particular element from array 
or map
{code}
select array(1, 2, 3)[2] from dual;
OK
3
{code}

> INDEX UDF is not working
> ------------------------
>
>                 Key: HIVE-3044
>                 URL: https://issues.apache.org/jira/browse/HIVE-3044
>             Project: Hive
>          Issue Type: Bug
>          Components: UDF
>    Affects Versions: 0.8.1
>            Reporter: Kristam Subba Swathi
>            Assignee: Aniket Mokashi
>
> Steps to reproduce
> ----------------------
> Create the table and load data
> Execute the index query
> Please find the sample code
> {code}
> createStatement.executeQuery("create table sample4(number array<int>) 
> partitioned by (part2 STRING)");
> createStatement.executeQuery("load data local inpath 
> '/home/hivecurwork/data/array.txt' into table sample4 partition (part2='x')");
> ResultSet executeQuery1 = createStatement.executeQuery("select 
> index(number,3) from sample4");
> while(executeQuery1.next())
> {
>   System.out.println("res:"+executeQuery1.getString(1));
> }
>  
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to