hive-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sungwoon Ma (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HIVE-15832) Hplsql UDF doesn't work in Hplsql
Date Tue, 07 Feb 2017 05:03:41 GMT
Sungwoon Ma created HIVE-15832:
----------------------------------

             Summary: Hplsql UDF doesn't work in Hplsql
                 Key: HIVE-15832
                 URL: https://issues.apache.org/jira/browse/HIVE-15832
             Project: Hive
          Issue Type: Bug
          Components: hpl/sql
    Affects Versions: 1.2.1
         Environment: HDP : 2.4.2.0-258
Hive lib : hive-XXX-1.2.1000.2.4.2.0-258.jar
Hplsql : hplsql-0.3.17.jar

            Reporter: Sungwoon Ma
             Fix For: 1.2.1



※ http://www.hplsql.org/udf


1) UDF Test 

[root@node2 /apps/hplsql]#./hplsql -e "SELECT hello(name) FROM USERS;" -trace
...
Ln:1 SELECT completed successfully
Ln:1 Standalone SELECT executed: 1 columns in the result set
Unhandled exception in HPL/SQL
...

2) Add 'Exception' (org.apache.hive.hplsql.Select)

>> 123 line 
- before :

      else if ((ctx.parent instanceof HplsqlParser.StmtContext)) {
        int cols = rm.getColumnCount();
        if (this.trace) {
          trace(ctx, "Standalone SELECT executed: " + cols + " columns in the result set");
        }
        while (rs.next()) {

- after :

        try {         
	        while (rs.next()) {
...
        }
        catch (Exception e) {
        	e.printStackTrace();
        }

- Error Log

[root@node2 /apps/hplsql]#./hplsql -e "SELECT hello(1) FROM USERS;" -trace
Configuration file: file:/apps/hplsql-0.3.17/hplsql-site.xml
Parser tree: (program (block (stmt (select_stmt (fullselect_stmt (fullselect_stmt_item (subselect_stmt
SELECT (select_list (select_list_item (expr (expr_func (ident hello) ( (expr_func_params (func_param
(expr (expr_atom (int_number 1))))) ))) (select_list_alias AS (ident A)))) (from_clause FROM
(from_table_clause (from_table_name_clause (table_name (ident USERS)))))))))) (stmt (semicolon_stmt
;))))
INLCUDE CONTENT hplsqlrc (non-empty)
Ln:1 CREATE FUNCTION hello
Ln:1 SELECT
>>registerUdf begin :false
>>registerUdf end :true
Ln:1 SELECT hplsql('hello(:1)', 1) AS A FROM USERS
17/02/06 20:28:13 INFO jdbc.Utils: Supplied authorities: node3:10000
17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:10000
Open connection: jdbc:hive2://node3:10000 (225 ms)
Starting pre-SQL statement
Starting pre-SQL statement
Starting pre-SQL statement
Starting pre-SQL statement
Starting pre-SQL statement
Starting query
Query executed successfully (84 ms)
Ln:1 SELECT completed successfully
Ln:1 Standalone SELECT executed: 1 columns in the result set
cols:1
org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException:
java.util.zip.ZipException: invalid code lengths set
 at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:258)
 at org.apache.hive.jdbc.Utils.verifySuccessWithInfo(Utils.java:244)
 at org.apache.hive.jdbc.HiveQueryResultSet.next(HiveQueryResultSet.java:364)
 at org.apache.hive.hplsql.Select.select(Select.java:116)
 at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:870)
 at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1)
 at org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14249)
 at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
 at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:865)
 at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1)
 at org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:998)
 at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
 at org.apache.hive.hplsql.HplsqlBaseVisitor.visitBlock(HplsqlBaseVisitor.java:28)
 at org.apache.hive.hplsql.HplsqlParser$BlockContext.accept(HplsqlParser.java:438)
 at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
 at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:780)
 at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:1)
 at org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:381)
 at org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
 at org.apache.hive.hplsql.Exec.run(Exec.java:652)
 at org.apache.hive.hplsql.Exec.run(Exec.java:630)
 at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
Caused by: org.apache.hive.service.cli.HiveSQLException: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException:
java.util.zip.ZipException: invalid code lengths set
 at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:352)
 at org.apache.hive.service.cli.operation.OperationManager.getOperationNextRowSet(OperationManager.java:223)
 at org.apache.hive.service.cli.session.HiveSessionImpl.fetchResults(HiveSessionImpl.java:716)
 at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:483)
 at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:78)
 at org.apache.hive.service.cli.session.HiveSessionProxy.access$000(HiveSessionProxy.java:36)
 at org.apache.hive.service.cli.session.HiveSessionProxy$1.run(HiveSessionProxy.java:63)
 at java.security.AccessController.doPrivileged(Native Method)
 at javax.security.auth.Subject.doAs(Subject.java:422)
 at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1709)
 at org.apache.hive.service.cli.session.HiveSessionProxy.invoke(HiveSessionProxy.java:59)
 at com.sun.proxy.$Proxy20.fetchResults(Unknown Source)
 at org.apache.hive.service.cli.CLIService.fetchResults(CLIService.java:456)
 at org.apache.hive.service.cli.thrift.ThriftCLIService.FetchResults(ThriftCLIService.java:672)
 at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1557)
 at org.apache.hive.service.cli.thrift.TCLIService$Processor$FetchResults.getResult(TCLIService.java:1542)
 at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
 at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:39)
 at org.apache.hive.service.auth.TSetIpAddressProcessor.process(TSetIpAddressProcessor.java:56)
 at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:285)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: org.apache.hadoop.hive.ql.metadata.HiveException: java.util.zip.ZipException:
invalid code lengths set
 at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:157)
 at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:1745)
 at org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:347)
 ... 24 more
Caused by: org.apache.hadoop.hive.ql.metadata.HiveException: java.util.zip.ZipException: invalid
code lengths set
 at org.apache.hive.hplsql.Udf.evaluate(Udf.java:70)
 at org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:186)
 at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:77)
 at org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:65)
 at org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:81)
 at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:838)
 at org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:117)
 at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:429)
 at org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:421)
 at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:143)
 ... 26 more






--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message