[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-03-25 Thread Pengcheng Xiong (JIRA)

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

Pengcheng Xiong commented on HIVE-15832:


Hello, I am deferring this to Hive 3.0 as we are going to cut the first RC and 
it is not marked as blocker. Please feel free to commit to the branch if this 
can be resolved before the release.

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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: 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-08 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


Thanks [~Ferd] i will file a new ticket. 

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-08 Thread Ferdinand Xu (JIRA)

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

Ferdinand Xu commented on HIVE-15832:
-

Thanks [~ferhui] for working on this issue. Your patch is addressing a NPE 
instead of the error mentioned in the description. Can you file a new ticket 
about the error you met and attach your patch there? BTW, is it possible to add 
some tests to avoid regression?

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-08 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


CC [~Ferd], could you please give any suggestions ,thanks

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-08 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


failing tests are not related, could please take a look and give suggestions 
[~dmtolpeko], thanks

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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: 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-08 Thread Hive QA (JIRA)

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

Hive QA commented on HIVE-15832:




Here are the results of testing the latest attachment:
https://issues.apache.org/jira/secure/attachment/12851574/HIVE-15832.patch

{color:red}ERROR:{color} -1 due to no test(s) being added or modified.

{color:red}ERROR:{color} -1 due to 4 failed/errored test(s), 10241 tests 
executed
*Failed tests:*
{noformat}
TestDerbyConnector - did not produce a TEST-*.xml file (likely timed out) 
(batchId=235)
org.apache.hadoop.hive.cli.TestEncryptedHDFSCliDriver.testCliDriver[encryption_join_with_different_encryption_keys]
 (batchId=159)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query14] 
(batchId=223)
org.apache.hadoop.hive.cli.TestPerfCliDriver.testCliDriver[query23] 
(batchId=223)
{noformat}

Test results: https://builds.apache.org/job/PreCommit-HIVE-Build/3437/testReport
Console output: https://builds.apache.org/job/PreCommit-HIVE-Build/3437/console
Test logs: http://104.198.109.242/logs/PreCommit-HIVE-Build-3437/

Messages:
{noformat}
Executing org.apache.hive.ptest.execution.TestCheckPhase
Executing org.apache.hive.ptest.execution.PrepPhase
Executing org.apache.hive.ptest.execution.ExecutionPhase
Executing org.apache.hive.ptest.execution.ReportingPhase
Tests exited with: TestsFailedException: 4 tests failed
{noformat}

This message is automatically generated.

ATTACHMENT ID: 12851574 - PreCommit-HIVE-Build

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-07 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


CC [~dmtolpeko]

> 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
>Assignee: Fei Hui
>  Labels: test
> Fix For: 1.2.1
>
> Attachments: HIVE-15832.patch
>
>
> ※ 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-07 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


here is error log i get, it is different hive 1.2.1
Caused by: java.lang.NullPointerException
at org.apache.hive.hplsql.Exec.setVariable(Exec.java:148) 
~[hive-hplsql-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hive.hplsql.Exec.setVariable(Exec.java:158) 
~[hive-hplsql-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hive.hplsql.Udf.setParameters(Udf.java:92) 
~[hive-hplsql-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hive.hplsql.Udf.evaluate(Udf.java:74) 
~[hive-hplsql-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.ExprNodeGenericFuncEvaluator._evaluate(ExprNodeGenericFuncEvaluator.java:187)
 ~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:80)
 ~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.ExprNodeEvaluator.evaluate(ExprNodeEvaluator.java:68)
 ~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.SelectOperator.process(SelectOperator.java:88) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hadoop.hive.ql.exec.Operator.forward(Operator.java:897) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.TableScanOperator.process(TableScanOperator.java:130)
 ~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:438) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hadoop.hive.ql.exec.FetchOperator.pushRow(FetchOperator.java:430) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hadoop.hive.ql.exec.FetchTask.fetch(FetchTask.java:147) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at org.apache.hadoop.hive.ql.Driver.getResults(Driver.java:2209) 
~[hive-exec-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]
at 
org.apache.hive.service.cli.operation.SQLOperation.getNextRowSet(SQLOperation.java:492)
 ~[hive-service-2.2.0-SNAPSHOT.jar:2.2.0-SNAPSHOT]

> 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
>Assignee: Fei Hui
>  Labels: test
> 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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: 
> 

[jira] [Commented] (HIVE-15832) Hplsql UDF doesn't work in Hplsql

2017-02-07 Thread Fei Hui (JIRA)

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

Fei Hui commented on HIVE-15832:


i have reproduced it on hive 2.2.0
i will work on it

> 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
>  Labels: test
> 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:1
> 17/02/06 20:28:13 INFO jdbc.Utils: Resolved authority: node3:1
> Open connection: jdbc:hive2://node3:1 (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)
>