You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "Kristam Subba Swathi (JIRA)" <ji...@apache.org> on 2012/05/23 06:24:40 UTC
[jira] [Created] (HIVE-3044) INDEX UDF is not working
Kristam Subba Swathi created HIVE-3044:
------------------------------------------
Summary: 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
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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HIVE-3044) INDEX UDF is not working
Posted by "Aniket Mokashi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13400950#comment-13400950 ]
Aniket Mokashi commented on HIVE-3044:
--------------------------------------
This is probably broken because index is a keyword in hive.
For example-
{code}
hive> describe function index;
org.apache.hadoop.hive.ql.parse.ParseException: line 1:18 cannot recognize input near 'index' '<EOF>' '<EOF>' in describe statement
{code}
I can think of 2 options-
1. Fix the parser to identify this as udf
OR
2. (easier) rename the udf to get_index.
Thoughts?
The current workaround is-
create temporary function get_index as 'org.apache.hadoop.hive.ql.udf.generic.GenericUDFIndex';
> 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: Chinna Rao Lalam
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (HIVE-3044) INDEX UDF is not working
Posted by "Kristam Subba Swathi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13281401#comment-13281401 ]
Kristam Subba Swathi commented on HIVE-3044:
--------------------------------------------
Please find the exception trace for more details
{noformat}
2012-05-23 10:20:05,911 ERROR ql.Driver (SessionState.java:printError(400)) - FAILED: ParseException line 1:7 cannot recognize input near 'index' '(' 'number' in select clause
org.apache.hadoop.hive.ql.parse.ParseException: line 1:7 cannot recognize input near 'index' '(' 'number' in select clause
at org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:441)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:415)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:335)
at org.apache.hadoop.hive.ql.Driver.run(Driver.java:901)
at org.apache.hadoop.hive.service.HiveServer$HiveServerHandler.execute(HiveServer.java:191)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:629)
at org.apache.hadoop.hive.service.ThriftHive$Processor$execute.getResult(ThriftHive.java:617)
at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32)
at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34)
at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:176)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
{noformat}
> 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: Chinna Rao Lalam
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (HIVE-3044) INDEX UDF is not working
Posted by "Chinna Rao Lalam (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chinna Rao Lalam reassigned HIVE-3044:
--------------------------------------
Assignee: Chinna Rao Lalam
> 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: Chinna Rao Lalam
>
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (HIVE-3044) INDEX UDF is not working
Posted by "Aniket Mokashi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HIVE-3044?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aniket Mokashi reassigned HIVE-3044:
------------------------------------
Assignee: Aniket Mokashi (was: Chinna Rao Lalam)
> 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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira