[jira] [Commented] (HIVE-17630) RESIGNAL:actual results are inconsistent with expectations at hplsql

2017-10-12 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17630:
---

So far I can just confirm that the problem exists, for some reason there were 
no unit tests for resignal and the logic was broken at some stage. I will try 
to fix it.

> RESIGNAL:actual results are inconsistent with expectations at hplsql
> 
>
> Key: HIVE-17630
> URL: https://issues.apache.org/jira/browse/HIVE-17630
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.2.0, 3.0.0
>Reporter: ZhangBing Lin
>Assignee: Dmitry Tolpeko
>Priority: Minor
>
> when I execute example 3 at [http://www.hplsql.org/resignal]:
> BEGIN
>   DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   BEGIN
> GET DIAGNOSTICS EXCEPTION 1 text = MESSAGE_TEXT;
> PRINT 'SQLSTATE: ' || SQLSTATE;
> PRINT 'Text: ' || text;
>   END; 
>  
>   BEGIN
> DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   RESIGNAL SQLSTATE '02031' SET MESSAGE_TEXT = 'Some error';
>  
> SELECT * FROM abc.abc;-- Table does not exist, raise an exception
>   END;
> END;
> Actual results:
> SQLSTATE: 42S02
> Text: Error while compiling statement: FAILED: SemanticException [Error 
> 10001]: Line 1:14 Table not found 'abc'
>  
> The official result is:
> SQLSTATE: 02031
> Text: Some error



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17630) RESIGNAL:actual results are inconsistent with expectations at hplsql

2017-09-27 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17630:
---

I will check this.

> RESIGNAL:actual results are inconsistent with expectations at hplsql
> 
>
> Key: HIVE-17630
> URL: https://issues.apache.org/jira/browse/HIVE-17630
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: ZhangBing Lin
>Assignee: Dmitry Tolpeko
>Priority: Minor
>
> when I execute example 3 at [http://www.hplsql.org/resignal]:
> BEGIN
>   DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   BEGIN
> GET DIAGNOSTICS EXCEPTION 1 text = MESSAGE_TEXT;
> PRINT 'SQLSTATE: ' || SQLSTATE;
> PRINT 'Text: ' || text;
>   END; 
>  
>   BEGIN
> DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   RESIGNAL SQLSTATE '02031' SET MESSAGE_TEXT = 'Some error';
>  
> SELECT * FROM abc.abc;-- Table does not exist, raise an exception
>   END;
> END;
> Actual results:
> SQLSTATE: 42S02
> Text: Error while compiling statement: FAILED: SemanticException [Error 
> 10001]: Line 1:14 Table not found 'abc'
>  
> The official result is:
> SQLSTATE: 02031
> Text: Some error



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17630) RESIGNAL:actual results are inconsistent with expectations at hplsql

2017-09-27 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17630?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17630:
-

Assignee: Dmitry Tolpeko

> RESIGNAL:actual results are inconsistent with expectations at hplsql
> 
>
> Key: HIVE-17630
> URL: https://issues.apache.org/jira/browse/HIVE-17630
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: ZhangBing Lin
>Assignee: Dmitry Tolpeko
>Priority: Minor
>
> when I execute example 3 at [http://www.hplsql.org/resignal]:
> BEGIN
>   DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   BEGIN
> GET DIAGNOSTICS EXCEPTION 1 text = MESSAGE_TEXT;
> PRINT 'SQLSTATE: ' || SQLSTATE;
> PRINT 'Text: ' || text;
>   END; 
>  
>   BEGIN
> DECLARE EXIT HANDLER FOR SQLEXCEPTION
>   RESIGNAL SQLSTATE '02031' SET MESSAGE_TEXT = 'Some error';
>  
> SELECT * FROM abc.abc;-- Table does not exist, raise an exception
>   END;
> END;
> Actual results:
> SQLSTATE: 42S02
> Text: Error while compiling statement: FAILED: SemanticException [Error 
> 10001]: Line 1:14 Table not found 'abc'
>  
> The official result is:
> SQLSTATE: 02031
> Text: Some error



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17594) Unit format error in Copy.java

2017-09-26 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17594:
--
   Resolution: Fixed
Fix Version/s: 3.0.0
   Status: Resolved  (was: Patch Available)

> Unit format error in Copy.java
> --
>
> Key: HIVE-17594
> URL: https://issues.apache.org/jira/browse/HIVE-17594
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 3.0.0
>Reporter: Saijin Huang
>Assignee: Saijin Huang
>Priority: Minor
> Fix For: 3.0.0
>
> Attachments: HIVE-17594.1.patch
>
>
> In Copy.java,line 273,the unit "rows/sec" is inconsistent with the actual 
> value "rows/elapsed/1000.0".



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17594) Unit format error in Copy.java

2017-09-26 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17594:
---

I committed the patch. 

> Unit format error in Copy.java
> --
>
> Key: HIVE-17594
> URL: https://issues.apache.org/jira/browse/HIVE-17594
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 3.0.0
>Reporter: Saijin Huang
>Assignee: Saijin Huang
>Priority: Minor
> Attachments: HIVE-17594.1.patch
>
>
> In Copy.java,line 273,the unit "rows/sec" is inconsistent with the actual 
> value "rows/elapsed/1000.0".



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17598) HS2/HPL Integration: Output wrapper class

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17598?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17598:
-

Assignee: Dmitry Tolpeko

> HS2/HPL Integration: Output wrapper class
> -
>
> Key: HIVE-17598
> URL: https://issues.apache.org/jira/browse/HIVE-17598
> Project: Hive
>  Issue Type: Sub-task
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> When running in CLI mode, HPL/SQL outputs the final results to stdout, and 
> now when running in embedded mode it has to put them into a result set to be 
> further consumed by HiveServer2 clients. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17597) HS2/HPL Integration: Avoid direct JDBC calls in HPL/SQL

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17597?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17597:
-


> HS2/HPL Integration: Avoid direct JDBC calls in HPL/SQL
> ---
>
> Key: HIVE-17597
> URL: https://issues.apache.org/jira/browse/HIVE-17597
> Project: Hive
>  Issue Type: Sub-task
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> HPL/SQL currently uses JDBC to interact with Hive through HiveServer2. This 
> option will remain for standalone mode (CLI mode), but when HPL/SQL is used 
> within HiveServer2 it will use internal Hive API for database access. This 
> task is to refactor JDBC API calls used in HP/SQL classes and move them to 
> wrapper classes.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17596) HiveServer2 and HPL/SQL Integration

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17596:
--
Attachment: HiveServer2 and HPLSQL Integration.pdf

> HiveServer2 and HPL/SQL Integration
> ---
>
> Key: HIVE-17596
> URL: https://issues.apache.org/jira/browse/HIVE-17596
> Project: Hive
>  Issue Type: New Feature
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
> Attachments: HiveServer2 and HPLSQL Integration.pdf
>
>
> The main task for HiveServer2 and HPL/SQL integration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17596) HiveServer2 and HPL/SQL Integration

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17596?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17596:
-


> HiveServer2 and HPL/SQL Integration
> ---
>
> Key: HIVE-17596
> URL: https://issues.apache.org/jira/browse/HIVE-17596
> Project: Hive
>  Issue Type: New Feature
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> The main task for HiveServer2 and HPL/SQL integration.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17452:
--
   Resolution: Fixed
Fix Version/s: 3.0.0
   Status: Resolved  (was: Patch Available)

> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Fix For: 3.0.0
>
> Attachments: HIVE-17452.1.patch
>
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-25 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17452:
---

Committed. 

> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17452.1.patch
>
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17594) Unit format error in Copy.java

2017-09-25 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17594:
---

Can you please provide an example so I can add a test?

> Unit format error in Copy.java
> --
>
> Key: HIVE-17594
> URL: https://issues.apache.org/jira/browse/HIVE-17594
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 3.0.0
>Reporter: Saijin Huang
>Assignee: Saijin Huang
>Priority: Minor
> Attachments: HIVE-17594.1.patch
>
>
> In Copy.java,line 273,the unit "rows/sec" is inconsistent with the actual 
> value "rows/elapsed/1000.0".



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17594) Unit format error in Copy.java

2017-09-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17594?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17594:
--
Component/s: hpl/sql

> Unit format error in Copy.java
> --
>
> Key: HIVE-17594
> URL: https://issues.apache.org/jira/browse/HIVE-17594
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 3.0.0
>Reporter: Saijin Huang
>Assignee: Saijin Huang
>Priority: Minor
> Attachments: HIVE-17594.1.patch
>
>
> In Copy.java,line 273,the unit "rows/sec" is inconsistent with the actual 
> value "rows/elapsed/1000.0".



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-09-24 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17253:
--
Resolution: Fixed
Status: Resolved  (was: Patch Available)

> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
> Fix For: 3.0.0
>
> Attachments: HIVE-17253.1.patch
>
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy exploratory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-09-24 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17253:
---

Committed the patch. The SUMMARY statement can output summary based on a custom 
query, but I agree later we can utilize metastore stats to speed up the 
statement execution.  

> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
> Fix For: 3.0.0
>
> Attachments: HIVE-17253.1.patch
>
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy exploratory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13898) don't support add subtract multiply or divide for variable of decimal or double type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13898:
--
Affects Version/s: (was: 2.0.1)
   Status: Patch Available  (was: Open)

> don't support add subtract multiply or divide for variable of decimal or 
> double type
> 
>
> Key: HIVE-13898
> URL: https://issues.apache.org/jira/browse/HIVE-13898
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13898.1.patch, HIVE-13898.patch
>
>
> don't support
> int + decimal
> int + double
> decimal + double
> decimal + decimal
> double + double



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-13898) don't support add subtract multiply or divide for variable of decimal or double type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-13898:
---

Addition and subtraction are patched by HIVE-17031.

> don't support add subtract multiply or divide for variable of decimal or 
> double type
> 
>
> Key: HIVE-13898
> URL: https://issues.apache.org/jira/browse/HIVE-13898
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.1
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13898.1.patch, HIVE-13898.patch
>
>
> don't support
> int + decimal
> int + double
> decimal + double
> decimal + decimal
> double + double



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13898) don't support add subtract multiply or divide for variable of decimal or double type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13898:
--
Attachment: HIVE-13898.1.patch

Added tests and refactored code. 

> don't support add subtract multiply or divide for variable of decimal or 
> double type
> 
>
> Key: HIVE-13898
> URL: https://issues.apache.org/jira/browse/HIVE-13898
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.1
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13898.1.patch, HIVE-13898.patch
>
>
> don't support
> int + decimal
> int + double
> decimal + double
> decimal + decimal
> double + double



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-14862) Problems handling escaped quotes within strings

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-14862:
--
Affects Version/s: (was: 2.1.0)
   Status: Patch Available  (was: Open)

> Problems handling escaped quotes within strings
> ---
>
> Key: HIVE-14862
> URL: https://issues.apache.org/jira/browse/HIVE-14862
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Maxim Glukhov
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-14862.1.patch
>
>
> It seems that hpl/sql is not properly handling escaped quotes when it happens 
> exactly at the string end. In example below, first command produces correct 
> result, while second command produces invalid result:
> PRINT ''' ';
> PRINT ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-14862) Problems handling escaped quotes within strings

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14862?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-14862:
--
Attachment: HIVE-14862.1.patch

> Problems handling escaped quotes within strings
> ---
>
> Key: HIVE-14862
> URL: https://issues.apache.org/jira/browse/HIVE-14862
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Maxim Glukhov
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-14862.1.patch
>
>
> It seems that hpl/sql is not properly handling escaped quotes when it happens 
> exactly at the string end. In example below, first command produces correct 
> result, while second command produces invalid result:
> PRINT ''' ';
> PRINT ;



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-14416) NPE trying to move results of a subselect into an RDBMS using HPL/SQL

2017-09-11 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14416:
---

By the way, there is no NPE anymore on 3.0.0 master. 

> NPE trying to move results of a subselect into an RDBMS using HPL/SQL
> -
>
> Key: HIVE-14416
> URL: https://issues.apache.org/jira/browse/HIVE-14416
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> I was trying to use HPL/SQL to move some records from Hive to MySQL using 
> this script:
> {code}
> MAP OBJECT remote TO pgtable AT mydbconn;
> insert into remote values ( select * from hivetable );
> {code}
> When I run this script I get this NPE:
> {code}
> Open connection: jdbc:hive2://hdp250.example.com:1 (285 ms)
> Starting query
> Query executed successfully (127 ms)
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
>   at org.apache.hive.hplsql.Select.select(Select.java:88)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
>   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:446)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:760)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:736)
>   at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> {code}
> This is my configuration:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (HIVE-14416) NPE trying to move results of a subselect into an RDBMS using HPL/SQL

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko resolved HIVE-14416.
---
Resolution: Not A Problem

> NPE trying to move results of a subselect into an RDBMS using HPL/SQL
> -
>
> Key: HIVE-14416
> URL: https://issues.apache.org/jira/browse/HIVE-14416
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> I was trying to use HPL/SQL to move some records from Hive to MySQL using 
> this script:
> {code}
> MAP OBJECT remote TO pgtable AT mydbconn;
> insert into remote values ( select * from hivetable );
> {code}
> When I run this script I get this NPE:
> {code}
> Open connection: jdbc:hive2://hdp250.example.com:1 (285 ms)
> Starting query
> Query executed successfully (127 ms)
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
>   at org.apache.hive.hplsql.Select.select(Select.java:88)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
>   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:446)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:760)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:736)
>   at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> {code}
> This is my configuration:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-14416) NPE trying to move results of a subselect into an RDBMS using HPL/SQL

2017-09-11 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14416:
---

Currently INSERT AS SELECT works within a single database as atom statement, so 
it is not separate select from one database and insert into another. To get the 
required functionality use COPY statement. http://hplsql.org/copy

{code}
copy (select * from hivetable) to remote at mydbconn;
{code}

> NPE trying to move results of a subselect into an RDBMS using HPL/SQL
> -
>
> Key: HIVE-14416
> URL: https://issues.apache.org/jira/browse/HIVE-14416
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> I was trying to use HPL/SQL to move some records from Hive to MySQL using 
> this script:
> {code}
> MAP OBJECT remote TO pgtable AT mydbconn;
> insert into remote values ( select * from hivetable );
> {code}
> When I run this script I get this NPE:
> {code}
> Open connection: jdbc:hive2://hdp250.example.com:1 (285 ms)
> Starting query
> Query executed successfully (127 ms)
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
>   at org.apache.hive.hplsql.Select.select(Select.java:88)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
>   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:446)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:760)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:736)
>   at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> {code}
> This is my configuration:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-14416) NPE trying to move results of a subselect into an RDBMS using HPL/SQL

2017-09-11 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14416:
---

Correct syntax to insert from a subquery is

{code}
insert into remote select * from hivetable;
{code}

VALUES clause is only used to insert specified column values.

> NPE trying to move results of a subselect into an RDBMS using HPL/SQL
> -
>
> Key: HIVE-14416
> URL: https://issues.apache.org/jira/browse/HIVE-14416
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> I was trying to use HPL/SQL to move some records from Hive to MySQL using 
> this script:
> {code}
> MAP OBJECT remote TO pgtable AT mydbconn;
> insert into remote values ( select * from hivetable );
> {code}
> When I run this script I get this NPE:
> {code}
> Open connection: jdbc:hive2://hdp250.example.com:1 (285 ms)
> Starting query
> Query executed successfully (127 ms)
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
>   at org.apache.hive.hplsql.Select.select(Select.java:88)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
>   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:446)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:760)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:736)
>   at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> {code}
> This is my configuration:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17023) HPL/SQL: NPE creating table if datatype lacks a precision and hplsql.conn.convert.hiveconn is false

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17023?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17023:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: NPE creating table if datatype lacks a precision and 
> hplsql.conn.convert.hiveconn is false
> ---
>
> Key: HIVE-17023
> URL: https://issues.apache.org/jira/browse/HIVE-17023
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> If you run with this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
> 
> You will get exceptions like this for some of the types:
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> ...
> FAIL: create table test1 (col1 integer);
> FAIL: create table test2 (col1 double);
> SUCCESS: create table test3 (col1 decimal(10, 4));
> FAIL: create table test4 (col1 string);
> SUCCESS: create table test5(col1 varchar(20));
> Problem boils down to this line in Stmt.java:
> exec.append(sql, exec.evalPop(col.dtype(), col.dtype_len()), 
> col.column_name().getStop(), col.dtype().getStart());
> Because col.dtype_len() returns null
> I have to wonder if not converting is ever a good idea? If it's always a bad 
> idea(tm) why even have it?
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-14416) NPE trying to move results of a subselect into an RDBMS using HPL/SQL

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14416?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-14416:
-

Assignee: Dmitry Tolpeko

> NPE trying to move results of a subselect into an RDBMS using HPL/SQL
> -
>
> Key: HIVE-14416
> URL: https://issues.apache.org/jira/browse/HIVE-14416
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> I was trying to use HPL/SQL to move some records from Hive to MySQL using 
> this script:
> {code}
> MAP OBJECT remote TO pgtable AT mydbconn;
> insert into remote values ( select * from hivetable );
> {code}
> When I run this script I get this NPE:
> {code}
> Open connection: jdbc:hive2://hdp250.example.com:1 (285 ms)
> Starting query
> Query executed successfully (127 ms)
> Exception in thread "main" java.lang.NullPointerException
>   at org.apache.hive.hplsql.Select.getIntoCount(Select.java:405)
>   at org.apache.hive.hplsql.Select.select(Select.java:88)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:1002)
>   at org.apache.hive.hplsql.Exec.visitSelect_stmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$Select_stmtContext.accept(HplsqlParser.java:14768)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:994)
>   at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1012)
>   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:446)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:901)
>   at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
>   at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:389)
>   at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:760)
>   at org.apache.hive.hplsql.Exec.run(Exec.java:736)
>   at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>   at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>   at java.lang.reflect.Method.invoke(Method.java:498)
>   at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
>   at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> {code}
> This is my configuration:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13923) don't support DATETIME type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13923:
--
Attachment: HIVE-13923.1.patch

Updated the patch with a test.

> don't support DATETIME type
> ---
>
> Key: HIVE-13923
> URL: https://issues.apache.org/jira/browse/HIVE-13923
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13923.1.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13923) don't support DATETIME type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13923:
--
Status: Patch Available  (was: Open)

> don't support DATETIME type
> ---
>
> Key: HIVE-13923
> URL: https://issues.apache.org/jira/browse/HIVE-13923
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13923.1.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13923) don't support DATETIME type

2017-09-11 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13923:
--
Attachment: (was: HIVE-13923.patch)

> don't support DATETIME type
> ---
>
> Key: HIVE-13923
> URL: https://issues.apache.org/jira/browse/HIVE-13923
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13923.1.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-13923) don't support DATETIME type

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13923?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-13923:
-

Assignee: Dmitry Tolpeko

> don't support DATETIME type
> ---
>
> Key: HIVE-13923
> URL: https://issues.apache.org/jira/browse/HIVE-13923
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13923.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-12676) [hive+impala] Alter table Rename to + Set location in a single step

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-12676:
--
Component/s: (was: hpl/sql)

> [hive+impala] Alter table Rename to + Set location in a single step
> ---
>
> Key: HIVE-12676
> URL: https://issues.apache.org/jira/browse/HIVE-12676
> Project: Hive
>  Issue Type: Improvement
>Reporter: Egmont Koblinger
>Assignee: Dmitry Tolpeko
>Priority: Minor
>
> Assume a nonstandard table location, let's say /foo/bar/table1. You might 
> want to rename from table1 to table2 and move the underlying data accordingly 
> to /foo/bar/table2.
> The "alter table ... rename to ..." clause alters the table name, but in the 
> same step moves the data into the standard location 
> /user/hive/warehouse/table2. Then a subsequent "alter table ... set location 
> ..." can move it back to the desired location /foo/bar/table2.
> This is problematic if there's any permission problem in the game, e.g. not 
> being able to write to /user/hive/warehouse. So it should be possible to move 
> the underlying data to its desired final place without intermittent places in 
> between.
> A probably hard to discover workaround is to set the table to external, then 
> rename it, then set back to internal and then change its location.
> It would be great to be able to do an "alter table ... rename to ... set 
> location ..." operation in a single step.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-12676) [hive+impala] Alter table Rename to + Set location in a single step

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12676?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-12676:
-

Assignee: (was: Dmitry Tolpeko)

> [hive+impala] Alter table Rename to + Set location in a single step
> ---
>
> Key: HIVE-12676
> URL: https://issues.apache.org/jira/browse/HIVE-12676
> Project: Hive
>  Issue Type: Improvement
>Reporter: Egmont Koblinger
>Priority: Minor
>
> Assume a nonstandard table location, let's say /foo/bar/table1. You might 
> want to rename from table1 to table2 and move the underlying data accordingly 
> to /foo/bar/table2.
> The "alter table ... rename to ..." clause alters the table name, but in the 
> same step moves the data into the standard location 
> /user/hive/warehouse/table2. Then a subsequent "alter table ... set location 
> ..." can move it back to the desired location /foo/bar/table2.
> This is problematic if there's any permission problem in the game, e.g. not 
> being able to write to /user/hive/warehouse. So it should be possible to move 
> the underlying data to its desired final place without intermittent places in 
> between.
> A probably hard to discover workaround is to set the table to external, then 
> rename it, then set back to internal and then change its location.
> It would be great to be able to do an "alter table ... rename to ... set 
> location ..." operation in a single step.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-14417) HPL/SQL: Wrong syntax generated for Postgres INSERT

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14417?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-14417:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: Wrong syntax generated for Postgres INSERT
> ---
>
> Key: HIVE-14417
> URL: https://issues.apache.org/jira/browse/HIVE-14417
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.1.0
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Minor
>
> HPL/SQL doesn't claim any support for Postgres so I guess I can't really 
> complain. But if you do connect to Postgres and try an insert, this happens:
> {code}
> ERROR:  syntax error at or near "TABLE" at character 13
> STATEMENT:  INSERT INTO TABLE pgtable VALUES
>   (1, 2, 'a')
> {code}
> This "INSERT INTO TABLE" stuff isn't used against MySQL, my guess the code 
> generation assume it's Hive unless it's one of the other known databases so 
> it inserts the non-standard Hive-ism.
> This was my configuration when this happened:
> {code}
> 
>   
> hplsql.conn.default
> myhiveconn
>   
>   
> hplsql.conn.myhiveconn
> 
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://hdp250.example.com:1
>   
>   
> hplsql.conn.pgdbconn
> 
> org.postgresql.Driver;jdbc:postgresql://hdp250.example.com/vagrant?user=vagrantpassword=vagrant
>   
>   
> hplsql.conn.mydbconn
> 
> com.mysql.jdbc.Driver;jdbc:mysql://hdp250.example.com:3306/hive;hive;vagrant
>   
> 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-11741) Add a new hook to run before query parse/compile

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-11741?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-11741:
--
Component/s: (was: hpl/sql)

> Add a new hook to run before query parse/compile
> 
>
> Key: HIVE-11741
> URL: https://issues.apache.org/jira/browse/HIVE-11741
> Project: Hive
>  Issue Type: New Feature
>  Components: Parser, SQL
>Affects Versions: 1.2.1
>Reporter: Guilherme Braccialli
>Assignee: Guilherme Braccialli
>Priority: Minor
>  Labels: patch
> Attachments: HIVE-11741.patch
>
>
> It would be nice to allow developers to extend hive query language, making 
> possible to use custom wildcards on queries. 
> People uses Python or R to iterate over vectors or lists and create SQL 
> commands, this could be implemented directly on sql syntax.
> For example this python script:
> >>> sql = "SELECT state, "
> >>> for i in range(10):
> ...   sql += "   sum(case when type = " + str(i) + " then value end) as 
> sum_of_" + str(i) + " ,"
> ...
> >>> sql += " count(1) as  total FROM table"
> >>> print(sql)
> Could be written directly in extended sql like this:
> SELECT state,
> %for id = 1 to 10%
>sum(case when type = %id% then value end) as sum_of_%id%,
> %end%
> , count(1) as total
> FROM table
> GROUP BY state
> This kind of extensibility can be easily added if we add a new hook after 
> VariableSubstitution call on Driver.compile method.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-13898) don't support add subtract multiply or divide for variable of decimal or double type

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13898?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-13898:
-

Assignee: Dmitry Tolpeko

> don't support add subtract multiply or divide for variable of decimal or 
> double type
> 
>
> Key: HIVE-13898
> URL: https://issues.apache.org/jira/browse/HIVE-13898
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.1
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13898.patch
>
>
> don't support
> int + decimal
> int + double
> decimal + double
> decimal + decimal
> double + double



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-13897) don't support comparison operator for variable of decimal or double type

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13897?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-13897:
-

Assignee: Dmitry Tolpeko

> don't support comparison operator for variable of decimal or double type
> 
>
> Key: HIVE-13897
> URL: https://issues.apache.org/jira/browse/HIVE-13897
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.1
>Reporter: longgeligelong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13897.patch
>
>
> decimal can't compare to decimal
> decimal can't compare to double
> decimal can't compare to integer
> double can't compare to integer



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17032) HPL/SQL Comparisons are only supported with strings and integers

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17032:
--
Attachment: HIVE-17032.1.patch

> HPL/SQL Comparisons are only supported with strings and integers
> 
>
> Key: HIVE-17032
> URL: https://issues.apache.org/jira/browse/HIVE-17032
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17032.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Var.java:
> {code}
>   public int compareTo(Var v) {
> if (this == v) {
>   return 0;
> }
> else if (v == null) {
>   return -1;
> }
> else if (type == Type.BIGINT && v.type == Type.BIGINT) {
>   return ((Long)value).compareTo((Long)v.value);
> }
> else if (type == Type.STRING && v.type == Type.STRING) {
>   return ((String)value).compareTo((String)v.value);
> }
> return -1;
>   }
> {code}
> It's surprising that comparisons with doubles and decimals (for example) 
> don't work as expected.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17032) HPL/SQL Comparisons are only supported with strings and integers

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17032:
--
Status: Patch Available  (was: Open)

> HPL/SQL Comparisons are only supported with strings and integers
> 
>
> Key: HIVE-17032
> URL: https://issues.apache.org/jira/browse/HIVE-17032
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17032.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Var.java:
> {code}
>   public int compareTo(Var v) {
> if (this == v) {
>   return 0;
> }
> else if (v == null) {
>   return -1;
> }
> else if (type == Type.BIGINT && v.type == Type.BIGINT) {
>   return ((Long)value).compareTo((Long)v.value);
> }
> else if (type == Type.STRING && v.type == Type.STRING) {
>   return ((String)value).compareTo((String)v.value);
> }
> return -1;
>   }
> {code}
> It's surprising that comparisons with doubles and decimals (for example) 
> don't work as expected.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17031) HPL/SQL Addition/Subtraction only supported on integers, datetimes and intervals

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17031:
--
Status: Patch Available  (was: Open)

> HPL/SQL Addition/Subtraction only supported on integers, datetimes and 
> intervals
> 
>
> Key: HIVE-17031
> URL: https://issues.apache.org/jira/browse/HIVE-17031
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17031.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Expression.java:
> {code}
>   public void operatorSub(HplsqlParser.ExprContext ctx) {
> Var v1 = evalPop(ctx.expr(0));
> Var v2 = evalPop(ctx.expr(1));
> if (v1.value == null || v2.value == null) {
>   evalNull();
> }
> else if (v1.type == Type.BIGINT && v2.type == Type.BIGINT) {
>   exec.stackPush(new Var((Long)v1.value - (Long)v2.value));
> }
> else if (v1.type == Type.DATE && v2.type == Type.BIGINT) {
>   exec.stackPush(changeDateByInt((Date)v1.value, (Long)v2.value, false 
> /*subtract*/));
> }
> else if (v1.type == Type.DATE && v2.type == Type.INTERVAL) {
>   exec.stackPush(new Var(((Interval)v2.value).dateChange((Date)v1.value, 
> false /*subtract*/)));
> }
> else if (v1.type == Type.TIMESTAMP && v2.type == Type.INTERVAL) {
>   exec.stackPush(new 
> Var(((Interval)v2.value).timestampChange((Timestamp)v1.value, false 
> /*subtract*/), v1.scale));
> }
> else {
>   evalNull();
> }
>   }
> {code}
> So decimals and floating points are not considered. To be fair the docs don't 
> mention this as supported, but it is surprising.
> Need: Test case for comparisons and equality, including nulls
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17031) HPL/SQL Addition/Subtraction only supported on integers, datetimes and intervals

2017-09-10 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17031:
--
Attachment: HIVE-17031.1.patch

> HPL/SQL Addition/Subtraction only supported on integers, datetimes and 
> intervals
> 
>
> Key: HIVE-17031
> URL: https://issues.apache.org/jira/browse/HIVE-17031
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17031.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Expression.java:
> {code}
>   public void operatorSub(HplsqlParser.ExprContext ctx) {
> Var v1 = evalPop(ctx.expr(0));
> Var v2 = evalPop(ctx.expr(1));
> if (v1.value == null || v2.value == null) {
>   evalNull();
> }
> else if (v1.type == Type.BIGINT && v2.type == Type.BIGINT) {
>   exec.stackPush(new Var((Long)v1.value - (Long)v2.value));
> }
> else if (v1.type == Type.DATE && v2.type == Type.BIGINT) {
>   exec.stackPush(changeDateByInt((Date)v1.value, (Long)v2.value, false 
> /*subtract*/));
> }
> else if (v1.type == Type.DATE && v2.type == Type.INTERVAL) {
>   exec.stackPush(new Var(((Interval)v2.value).dateChange((Date)v1.value, 
> false /*subtract*/)));
> }
> else if (v1.type == Type.TIMESTAMP && v2.type == Type.INTERVAL) {
>   exec.stackPush(new 
> Var(((Interval)v2.value).timestampChange((Timestamp)v1.value, false 
> /*subtract*/), v1.scale));
> }
> else {
>   evalNull();
> }
>   }
> {code}
> So decimals and floating points are not considered. To be fair the docs don't 
> mention this as supported, but it is surprising.
> Need: Test case for comparisons and equality, including nulls
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17030) HPL/SQL: Many cast operations are ignored without warning or notice.

2017-09-08 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17030:
--
Attachment: HIVE-17030.1.patch

> HPL/SQL: Many cast operations are ignored without warning or notice.
> 
>
> Key: HIVE-17030
> URL: https://issues.apache.org/jira/browse/HIVE-17030
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17030.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this code:
> {code}
>   val1d := cast('10.0' as double);
>   val2d := cast('5.0' as double);
>   declare val1i int = 5;
>   declare val2i int = 5;
>   val1i = val1d;
>   diff := val1i - val2i;
> {code}
> What is the value of diff? You might think it is 5 but in fact it is 0. Why? 
> Because when you attempt to assign val1i to val1d, this code in Var.java is 
> executed:
> {code}
> else if (type == Type.BIGINT) {
>   if (val.type == Type.STRING) {
> value = Long.parseLong((String)val.value);
>   }
> }
> else if (type == Type.DECIMAL) {
> {code}
> Since there is no case for assigning a double to a bigint, the expression is 
> essentially ignored and the value remains the same. This behavior leads to 
> many surprising results.
> It would be best if HPL/SQL could re-use the cast code from Hive since there 
> are a lot of cases to consider.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17030) HPL/SQL: Many cast operations are ignored without warning or notice.

2017-09-08 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17030:
--
Status: Patch Available  (was: Open)

> HPL/SQL: Many cast operations are ignored without warning or notice.
> 
>
> Key: HIVE-17030
> URL: https://issues.apache.org/jira/browse/HIVE-17030
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17030.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this code:
> {code}
>   val1d := cast('10.0' as double);
>   val2d := cast('5.0' as double);
>   declare val1i int = 5;
>   declare val2i int = 5;
>   val1i = val1d;
>   diff := val1i - val2i;
> {code}
> What is the value of diff? You might think it is 5 but in fact it is 0. Why? 
> Because when you attempt to assign val1i to val1d, this code in Var.java is 
> executed:
> {code}
> else if (type == Type.BIGINT) {
>   if (val.type == Type.STRING) {
> value = Long.parseLong((String)val.value);
>   }
> }
> else if (type == Type.DECIMAL) {
> {code}
> Since there is no case for assigning a double to a bigint, the expression is 
> essentially ignored and the value remains the same. This behavior leads to 
> many surprising results.
> It would be best if HPL/SQL could re-use the cast code from Hive since there 
> are a lot of cases to consider.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-13877) Hplsql UDF doesn't work in Hive Cli

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-13877:
-

Assignee: Dmitry Tolpeko

> Hplsql UDF doesn't work in Hive Cli
> ---
>
> Key: HIVE-13877
> URL: https://issues.apache.org/jira/browse/HIVE-13877
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.2.0
>Reporter: jiangxintong
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-13877.2.patch, HIVE-13877.patch
>
>
> Hive cli will throw "Error evaluating hplsql" exception when i use the hplsql 
> udf like "SELECT hplsql('hello[:1]', columnName) FROM tableName".



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17032) HPL/SQL Comparisons are only supported with strings and integers

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17032?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17032:
-

Assignee: Dmitry Tolpeko

> HPL/SQL Comparisons are only supported with strings and integers
> 
>
> Key: HIVE-17032
> URL: https://issues.apache.org/jira/browse/HIVE-17032
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Var.java:
> {code}
>   public int compareTo(Var v) {
> if (this == v) {
>   return 0;
> }
> else if (v == null) {
>   return -1;
> }
> else if (type == Type.BIGINT && v.type == Type.BIGINT) {
>   return ((Long)value).compareTo((Long)v.value);
> }
> else if (type == Type.STRING && v.type == Type.STRING) {
>   return ((String)value).compareTo((String)v.value);
> }
> return -1;
>   }
> {code}
> It's surprising that comparisons with doubles and decimals (for example) 
> don't work as expected.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17031) HPL/SQL Addition/Subtraction only supported on integers, datetimes and intervals

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17031?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17031:
-

Assignee: Dmitry Tolpeko

> HPL/SQL Addition/Subtraction only supported on integers, datetimes and 
> intervals
> 
>
> Key: HIVE-17031
> URL: https://issues.apache.org/jira/browse/HIVE-17031
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In Expression.java:
> {code}
>   public void operatorSub(HplsqlParser.ExprContext ctx) {
> Var v1 = evalPop(ctx.expr(0));
> Var v2 = evalPop(ctx.expr(1));
> if (v1.value == null || v2.value == null) {
>   evalNull();
> }
> else if (v1.type == Type.BIGINT && v2.type == Type.BIGINT) {
>   exec.stackPush(new Var((Long)v1.value - (Long)v2.value));
> }
> else if (v1.type == Type.DATE && v2.type == Type.BIGINT) {
>   exec.stackPush(changeDateByInt((Date)v1.value, (Long)v2.value, false 
> /*subtract*/));
> }
> else if (v1.type == Type.DATE && v2.type == Type.INTERVAL) {
>   exec.stackPush(new Var(((Interval)v2.value).dateChange((Date)v1.value, 
> false /*subtract*/)));
> }
> else if (v1.type == Type.TIMESTAMP && v2.type == Type.INTERVAL) {
>   exec.stackPush(new 
> Var(((Interval)v2.value).timestampChange((Timestamp)v1.value, false 
> /*subtract*/), v1.scale));
> }
> else {
>   evalNull();
> }
>   }
> {code}
> So decimals and floating points are not considered. To be fair the docs don't 
> mention this as supported, but it is surprising.
> Need: Test case for comparisons and equality, including nulls
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17030) HPL/SQL: Many cast operations are ignored without warning or notice.

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17030?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17030:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: Many cast operations are ignored without warning or notice.
> 
>
> Key: HIVE-17030
> URL: https://issues.apache.org/jira/browse/HIVE-17030
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this code:
> {code}
>   val1d := cast('10.0' as double);
>   val2d := cast('5.0' as double);
>   declare val1i int = 5;
>   declare val2i int = 5;
>   val1i = val1d;
>   diff := val1i - val2i;
> {code}
> What is the value of diff? You might think it is 5 but in fact it is 0. Why? 
> Because when you attempt to assign val1i to val1d, this code in Var.java is 
> executed:
> {code}
> else if (type == Type.BIGINT) {
>   if (val.type == Type.STRING) {
> value = Long.parseLong((String)val.value);
>   }
> }
> else if (type == Type.DECIMAL) {
> {code}
> Since there is no case for assigning a double to a bigint, the expression is 
> essentially ignored and the value remains the same. This behavior leads to 
> many surprising results.
> It would be best if HPL/SQL could re-use the cast code from Hive since there 
> are a lot of cases to consider.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17029) HPL/SQL: Comparison if not null-safe

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17029:
--
Status: Patch Available  (was: Open)

> HPL/SQL: Comparison if not null-safe
> 
>
> Key: HIVE-17029
> URL: https://issues.apache.org/jira/browse/HIVE-17029
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17029.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> If you run a statement like:
> {code}
>   if val1i > val2i then
> print('val1 greater');
>   end if;
> {code}
> And either val1 or val2 is null, you will get an exception similar to the 
> following:
> {code}
> Unhandled exception in HPL/SQL
> java.lang.NullPointerException
> at org.apache.hive.hplsql.Var.compareTo(Var.java:453)
> at 
> org.apache.hive.hplsql.Expression.operatorCompare(Expression.java:454)
> at 
> org.apache.hive.hplsql.Expression.execBoolBinary(Expression.java:178)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:1589)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_binaryContext.accept(HplsqlParser.java:19397)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at 
> org.apache.hive.hplsql.HplsqlBaseVisitor.visitBool_expr_atom(HplsqlBaseVisitor.java:1316)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_atomContext.accept(HplsqlParser.java:18985)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Expression.visit(Expression.java:660)
> at org.apache.hive.hplsql.Expression.eval(Expression.java:624)
> at org.apache.hive.hplsql.Expression.execBool(Expression.java:121)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17029) HPL/SQL: Comparison if not null-safe

2017-09-07 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17029:
--
Attachment: HIVE-17029.1.patch

> HPL/SQL: Comparison if not null-safe
> 
>
> Key: HIVE-17029
> URL: https://issues.apache.org/jira/browse/HIVE-17029
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17029.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> If you run a statement like:
> {code}
>   if val1i > val2i then
> print('val1 greater');
>   end if;
> {code}
> And either val1 or val2 is null, you will get an exception similar to the 
> following:
> {code}
> Unhandled exception in HPL/SQL
> java.lang.NullPointerException
> at org.apache.hive.hplsql.Var.compareTo(Var.java:453)
> at 
> org.apache.hive.hplsql.Expression.operatorCompare(Expression.java:454)
> at 
> org.apache.hive.hplsql.Expression.execBoolBinary(Expression.java:178)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:1589)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_binaryContext.accept(HplsqlParser.java:19397)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at 
> org.apache.hive.hplsql.HplsqlBaseVisitor.visitBool_expr_atom(HplsqlBaseVisitor.java:1316)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_atomContext.accept(HplsqlParser.java:18985)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Expression.visit(Expression.java:660)
> at org.apache.hive.hplsql.Expression.eval(Expression.java:624)
> at org.apache.hive.hplsql.Expression.execBool(Expression.java:121)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17029) HPL/SQL: Comparison if not null-safe

2017-09-06 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17029:
---

just for reference, in SQL Server: IF NULL > NULL executes ELSE block. 

> HPL/SQL: Comparison if not null-safe
> 
>
> Key: HIVE-17029
> URL: https://issues.apache.org/jira/browse/HIVE-17029
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> If you run a statement like:
> {code}
>   if val1i > val2i then
> print('val1 greater');
>   end if;
> {code}
> And either val1 or val2 is null, you will get an exception similar to the 
> following:
> {code}
> Unhandled exception in HPL/SQL
> java.lang.NullPointerException
> at org.apache.hive.hplsql.Var.compareTo(Var.java:453)
> at 
> org.apache.hive.hplsql.Expression.operatorCompare(Expression.java:454)
> at 
> org.apache.hive.hplsql.Expression.execBoolBinary(Expression.java:178)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:1589)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_binaryContext.accept(HplsqlParser.java:19397)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at 
> org.apache.hive.hplsql.HplsqlBaseVisitor.visitBool_expr_atom(HplsqlBaseVisitor.java:1316)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_atomContext.accept(HplsqlParser.java:18985)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Expression.visit(Expression.java:660)
> at org.apache.hive.hplsql.Expression.eval(Expression.java:624)
> at org.apache.hive.hplsql.Expression.execBool(Expression.java:121)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17028) Casting strings to integers in HPL/SQL differs from Hive behavior

2017-09-06 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17028:
--
Status: Patch Available  (was: Open)

> Casting strings to integers in HPL/SQL differs from Hive behavior
> -
>
> Key: HIVE-17028
> URL: https://issues.apache.org/jira/browse/HIVE-17028
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17028.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In HPL/SQL: cast('10.0' as integer); results in:
> Unhandled exception in HPL/SQL
> java.lang.NumberFormatException: For input string: "10.0"
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:589)
> at java.lang.Long.parseLong(Long.java:631)
> at org.apache.hive.hplsql.Var.cast(Var.java:181)
> In Hive:
> hive> select cast('10.0' as integer);
> 10
> Time taken: 4.563 seconds, Fetched: 1 row(s)
> hive> select cast('10.3' as integer);
> 10



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17028) Casting strings to integers in HPL/SQL differs from Hive behavior

2017-09-06 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17028:
--
Attachment: HIVE-17028.1.patch

> Casting strings to integers in HPL/SQL differs from Hive behavior
> -
>
> Key: HIVE-17028
> URL: https://issues.apache.org/jira/browse/HIVE-17028
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17028.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In HPL/SQL: cast('10.0' as integer); results in:
> Unhandled exception in HPL/SQL
> java.lang.NumberFormatException: For input string: "10.0"
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:589)
> at java.lang.Long.parseLong(Long.java:631)
> at org.apache.hive.hplsql.Var.cast(Var.java:181)
> In Hive:
> hive> select cast('10.0' as integer);
> 10
> Time taken: 4.563 seconds, Fetched: 1 row(s)
> hive> select cast('10.3' as integer);
> 10



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17452:
--
Attachment: HIVE-17452.1.patch

> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17452.1.patch
>
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17452:
--
Status: Patch Available  (was: Open)

> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17452.1.patch
>
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17452:
--
Component/s: hpl/sql

> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-05 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17027:
---

There are also issues with variable initialization, I created another ticket: 
HIVE-17452

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17027.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17452) HPL/SQL function variable block is not initialized

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17452?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17452:
-


> HPL/SQL function variable block is not initialized
> --
>
> Key: HIVE-17452
> URL: https://issues.apache.org/jira/browse/HIVE-17452
> Project: Hive
>  Issue Type: Bug
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> Variable inside declaration block are not initialized:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> AS
>   ret string DEFAULT 'Initial value';
> BEGIN
>   print(ret);
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> test1();
> {code}
> Output:
> {code}
> ret  
> VALUE IS SET
> {code}
> Should be:
> {code}
> Initial value 
> VALUE IS SET
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17027:
--
Attachment: HIVE-17027.1.patch

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17027.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-05 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17027:
--
Status: Patch Available  (was: Open)

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
> Attachments: HIVE-17027.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-05 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17027:
---

Actually HPL already parses double quoted strings as identifiers, I will change 
the logic to treat them as strings depending on the context, for example, in 
assignment expressions that are not part of SQL statements where conflict with 
column names is possible; and when there is no previously declared 
double-quoted variable etc.   

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-04 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17027:
---

Above script is not valid, so I modified it a little bit (removed VAR keyword 
and replaced DECLARE with AS):

{code}
CREATE FUNCTION test1()
  RETURNS STRING
AS
  ret string;
BEGIN
  ret := 'VALUE IS SET';
  print(ret);
END;

CREATE FUNCTION test2()
  RETURNS STRING
AS
  ret string;
BEGIN
  ret := "VALUE IS SET";
  print(ret);
END;

test1();
test2();
{code}

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-04 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17027:
---

For compatibility with Hive SQL 
(https://cwiki.apache.org/confluence/display/Hive/Literals) I will add support 
for double quotes in string literals. Later, from the context it would be 
possible to distinguish between column names and literals. 

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17029) HPL/SQL: Comparison if not null-safe

2017-09-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17029?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17029:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: Comparison if not null-safe
> 
>
> Key: HIVE-17029
> URL: https://issues.apache.org/jira/browse/HIVE-17029
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> If you run a statement like:
> {code}
>   if val1i > val2i then
> print('val1 greater');
>   end if;
> {code}
> And either val1 or val2 is null, you will get an exception similar to the 
> following:
> {code}
> Unhandled exception in HPL/SQL
> java.lang.NullPointerException
> at org.apache.hive.hplsql.Var.compareTo(Var.java:453)
> at 
> org.apache.hive.hplsql.Expression.operatorCompare(Expression.java:454)
> at 
> org.apache.hive.hplsql.Expression.execBoolBinary(Expression.java:178)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:1589)
> at org.apache.hive.hplsql.Exec.visitBool_expr_binary(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_binaryContext.accept(HplsqlParser.java:19397)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at 
> org.apache.hive.hplsql.HplsqlBaseVisitor.visitBool_expr_atom(HplsqlBaseVisitor.java:1316)
> at 
> org.apache.hive.hplsql.HplsqlParser$Bool_expr_atomContext.accept(HplsqlParser.java:18985)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Expression.visit(Expression.java:660)
> at org.apache.hive.hplsql.Expression.eval(Expression.java:624)
> at org.apache.hive.hplsql.Expression.execBool(Expression.java:121)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17027) HPL/SQL requires single quotes for string literals, resulting in surprising behavior

2017-09-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17027?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17027:
-

Assignee: Dmitry Tolpeko

> HPL/SQL requires single quotes for string literals, resulting in surprising 
> behavior
> 
>
> Key: HIVE-17027
> URL: https://issues.apache.org/jira/browse/HIVE-17027
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Consider this script:
> {code}
> CREATE FUNCTION test1()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := 'VALUE IS SET';
>   print(ret);
> END;
> CREATE FUNCTION test2()
>   RETURNS STRING
> DECLARE
>   VAR ret string;
> BEGIN
>   ret := "VALUE IS SET";
>   print(ret);
> END;
> test1();
> test2();
> {code}
> The output of this script is:
> VALUE IS SET
> ret
> Hive accepts both quoting styles. It would be better if HPL/SQL did as well, 
> or threw an error for th
> e unsupported style.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17028) Casting strings to integers in HPL/SQL differs from Hive behavior

2017-09-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17028?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17028:
-

Assignee: Dmitry Tolpeko

> Casting strings to integers in HPL/SQL differs from Hive behavior
> -
>
> Key: HIVE-17028
> URL: https://issues.apache.org/jira/browse/HIVE-17028
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> In HPL/SQL: cast('10.0' as integer); results in:
> Unhandled exception in HPL/SQL
> java.lang.NumberFormatException: For input string: "10.0"
> at 
> java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
> at java.lang.Long.parseLong(Long.java:589)
> at java.lang.Long.parseLong(Long.java:631)
> at org.apache.hive.hplsql.Var.cast(Var.java:181)
> In Hive:
> hive> select cast('10.0' as integer);
> 10
> Time taken: 4.563 seconds, Fetched: 1 row(s)
> hive> select cast('10.3' as integer);
> 10



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (HIVE-17026) HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master

2017-09-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko resolved HIVE-17026.
---
Resolution: Fixed

> HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master
> ---
>
> Key: HIVE-17026
> URL: https://issues.apache.org/jira/browse/HIVE-17026
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> The docs at http://www.hplsql.org/configuration#hplsqlconnhiveconn state:
> 
>   hplsql.conn.hiveconn
>   org.apache.hadoop.hive.jdbc.HiveDriver;jdbc:hive://
> 
> If you use that on current master you get:
> java.sql.SQLException: No suitable driver found for jdbc:hive://
> If you use hive2 it works fine. It's not clear to me if that's a change from 
> prior versions or not.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17026) HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master

2017-09-04 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17026:
---

I have updated the documentation http://hplsql.org/configuration, now hiveconn 
points to HiveServer2 embedded mode, while hive1conn points to old HiveServer 
emdedded mode (deprecated). This conforms to the current 
master/hplsql/src/main/resources/hplsql-site.xml

> HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master
> ---
>
> Key: HIVE-17026
> URL: https://issues.apache.org/jira/browse/HIVE-17026
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> The docs at http://www.hplsql.org/configuration#hplsqlconnhiveconn state:
> 
>   hplsql.conn.hiveconn
>   org.apache.hadoop.hive.jdbc.HiveDriver;jdbc:hive://
> 
> If you use that on current master you get:
> java.sql.SQLException: No suitable driver found for jdbc:hive://
> If you use hive2 it works fine. It's not clear to me if that's a change from 
> prior versions or not.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-12157) Support unicode for table/column names

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12157?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-12157:
--
Component/s: (was: hpl/sql)

>  Support unicode for table/column names
> ---
>
> Key: HIVE-12157
> URL: https://issues.apache.org/jira/browse/HIVE-12157
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: richard du
>Assignee: hefuhua
>Priority: Minor
> Attachments: HIVE-12157.01.patch, HIVE-12157.02.patch, 
> HIVE-12157.patch
>
>
> Parser will throw exception when I use alias:
> hive> desc test;
> OK
> a   int 
> b   string  
> Time taken: 0.135 seconds, Fetched: 2 row(s)
> hive> select a as 行1 from test limit 10;
> NoViableAltException(302@[134:7: ( ( ( KW_AS )? identifier ) | ( KW_AS LPAREN 
> identifier ( COMMA identifier )* RPAREN ) )?])
> at org.antlr.runtime.DFA.noViableAlt(DFA.java:158)
> at org.antlr.runtime.DFA.predict(DFA.java:116)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser_SelectClauseParser.selectItem(HiveParser_SelectClauseParser.java:2915)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser_SelectClauseParser.selectList(HiveParser_SelectClauseParser.java:1373)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser_SelectClauseParser.selectClause(HiveParser_SelectClauseParser.java:1128)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.selectClause(HiveParser.java:45827)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.selectStatement(HiveParser.java:41495)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.regularBody(HiveParser.java:41402)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpressionBody(HiveParser.java:40413)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.queryStatementExpression(HiveParser.java:40283)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.execStatement(HiveParser.java:1590)
> at 
> org.apache.hadoop.hive.ql.parse.HiveParser.statement(HiveParser.java:1109)
> at 
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:202)
> at 
> org.apache.hadoop.hive.ql.parse.ParseDriver.parse(ParseDriver.java:166)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:396)
> at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:308)
> at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1122)
> at org.apache.hadoop.hive.ql.Driver.runInternal(Driver.java:1170)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1059)
> at org.apache.hadoop.hive.ql.Driver.run(Driver.java:1049)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:213)
> at org.apache.hadoop.hive.cli.CliDriver.processCmd(CliDriver.java:165)
> at 
> org.apache.hadoop.hive.cli.CliDriver.processLine(CliDriver.java:376)
> at 
> org.apache.hadoop.hive.cli.CliDriver.executeDriver(CliDriver.java:736)
> at org.apache.hadoop.hive.cli.CliDriver.run(CliDriver.java:681)
> at org.apache.hadoop.hive.cli.CliDriver.main(CliDriver.java:621)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:606)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
> FAILED: ParseException line 1:13 cannot recognize input near 'as' '1' 'from' 
> in selection target



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-14160) Reduce-task costs a long time to finish on the condition that the certain sql "select a,distinct(b) group by a" has been executed on the data which has skew distribution

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14160?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-14160:
--
Component/s: (was: hpl/sql)

> Reduce-task costs a long time to finish on the condition that the certain sql 
> "select a,distinct(b) group by a" has been executed on the data which has 
> skew distribution
> -
>
> Key: HIVE-14160
> URL: https://issues.apache.org/jira/browse/HIVE-14160
> Project: Hive
>  Issue Type: Improvement
>Affects Versions: 1.1.0
>Reporter: marymwu
>
> Reduce-task costs a long time to finish on the condition that the certain sql 
> "select a,distinct(b) group by a" has been executed on the data which has 
> skew distribution
> data scale: 64G



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13992) Insert overwrite from Parquet Source Table to Parquet Destination Table throws InvocationTargetException

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13992?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13992:
--
Component/s: (was: hpl/sql)

> Insert overwrite from Parquet Source Table to Parquet Destination Table 
> throws InvocationTargetException
> 
>
> Key: HIVE-13992
> URL: https://issues.apache.org/jira/browse/HIVE-13992
> Project: Hive
>  Issue Type: Bug
>  Components: SQL
>Affects Versions: 1.2.0
>Reporter: Abhijit Das
>
> This issue is due to an issue in Hive-1.2 with bundled parquet JAR. The same 
> use case(s) are working good in Hive-0.14. 
> This issue is because, Hive-1.2 comes with a packaged parquet Jar 
> (parquet-hadoop-bundle-1.6.0.jar) inside "../hive-1.2.1/lib" , and while 
> executing parquet related functionalities Hive-1.2 uses this JAR from the 
> classpath.
> If the parquet JAR's which comes with Hadoop distribution is used instead of 
> Hive bundled parquet JARs, then these parquet related use cases(s) will work 
> fine.
> As the workaround, we need to execute "set 
> mapreduce.job.user.classpath.first=true" for each and every hive session. If 
> this workaround is implemented, then this will be a code change in 
> provisioning module.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-12745) Hive Timestamp value change after joining two tables

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12745?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-12745:
--
Component/s: (was: hpl/sql)

> Hive Timestamp value change after joining two tables
> 
>
> Key: HIVE-12745
> URL: https://issues.apache.org/jira/browse/HIVE-12745
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.2.1
>Reporter: wyp
>Assignee: Dmitry Tolpeko
>
> I have two Hive tables:test and test1:
> {code}
> CREATE TABLE `test`( `t` timestamp)
> CREATE TABLE `test1`( `t` timestamp)
> {code}
> they all holds a t value with Timestamp datatype,the contents of the two 
> table as follow:
> {code}
> hive> select * from test1;
> OK
> 1970-01-01 00:00:00
> 1970-03-02 00:00:00
> Time taken: 0.091 seconds, Fetched: 2 row(s)
> hive> select * from test;
> OK
> 1970-01-01 00:00:00
> 1970-01-02 00:00:00
> Time taken: 0.085 seconds, Fetched: 2 row(s)
> {code}
> However when joining this two table, the returned timestamp value changed:
> {code}
> hive> select test.t, test1.t from test, test1;
> OK
> 1969-12-31 23:00:00   1970-01-01 00:00:00
> 1970-01-01 23:00:00   1970-01-01 00:00:00
> 1969-12-31 23:00:00   1970-03-02 00:00:00
> 1970-01-01 23:00:00   1970-03-02 00:00:00
> Time taken: 54.347 seconds, Fetched: 4 row(s)
> {code}
> and I found the result is changed every time
> {code}
> hive> select test.t, test1.t from test, test1;
> OK
> 1970-01-01 00:00:00   1970-01-01 00:00:00
> 1970-01-02 00:00:00   1970-01-01 00:00:00
> 1970-01-01 00:00:00   1970-03-02 00:00:00
> 1970-01-02 00:00:00   1970-03-02 00:00:00
> Time taken: 26.308 seconds, Fetched: 4 row(s)
> {code}
> Any suggestion? Thanks



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-12226) Support unicode for table names

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-12226:
--
Component/s: (was: hpl/sql)

> Support unicode for table names
> ---
>
> Key: HIVE-12226
> URL: https://issues.apache.org/jira/browse/HIVE-12226
> Project: Hive
>  Issue Type: Sub-task
>Reporter: Pengcheng Xiong
>Assignee: richard du
>




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-16968) MAPJOIN hint error

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-16968?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-16968:
--
Component/s: (was: hpl/sql)

> MAPJOIN hint error
> --
>
> Key: HIVE-16968
> URL: https://issues.apache.org/jira/browse/HIVE-16968
> Project: Hive
>  Issue Type: Bug
>Affects Versions: 1.1.0
>Reporter: xujie
>
> set hive.auto.convert.join=false;
> set hive.ignore.mapjoin.hint=false;
> WITH  TEMP_CUST_BAL
> AS
> (
> SELECT   /*+ MAPJOIN(C) */  FROM FACT_RPSM.F_AGT_INFO_ALL B0 
>   LEFT JOIN  FACT_RPSM.F_AGT_INFO_BAL_AVG A ON  B0.JIZH_ID = a.JIZH_ID
>   AND  A.DT='20170625'
> LEFT JOIN  BASE.B_IF_PROD_DIM C
>   ON  B0.PROD_ID = C.PROD_ID 
>   AND  C.DT='20170625'
> WHERE  B0.DT='20170625'  
>   GROUP  BY B0.CUST_ID;
> -
> Your query has the following error(s):
> Invalid OperationHandle: OperationHandle [opType=EXECUTE_STATEMENT, 
> getHandleIdentifier()=7300a9f1-d6cf-418b-aa59-59a7688fa74e]



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-12216) WHERE on the FROM table not (always) working when JOIN are present

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-12216?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-12216:
--
Component/s: (was: hpl/sql)

> WHERE on the FROM table not (always) working when JOIN are present
> --
>
> Key: HIVE-12216
> URL: https://issues.apache.org/jira/browse/HIVE-12216
> Project: Hive
>  Issue Type: Bug
>  Components: Parser, Query Processor, SQL
>Affects Versions: 1.1.0, 1.2.1
> Environment: CDH 5.4.7 HDP2.3.2 MR TEZ
>Reporter: Bolke de Bruin
>Priority: Blocker
>
> In case we use a where clause in a state where also joins are present, the 
> clauses are not (always) respected. We have been able to reproduce this issue 
> consistently with Hive 1.1.0 on MR, Hive 1.2.1 on Tez (MR Fails here). 
> So fo the below query we *do* get results back like:
> 'gs.i_s_c = 23' (and this goes for all clauses!)
> CREATE TABLE tmp_hub_and_sats AS
> SELECT
>f.dt,
>f.t_c,
>sum(f.transaction_amount) as amount,
>sum(f.amount_euro) amount_euro,
>IF(f.org_grid is null, f.org_cust, f.org_grid) as org,
>IF(f.org_grid is null, 0, 1) as is_org_grid,
>IF(f.org_up is null, if(f.org_grid is null, f.org_cust, f.org_grid), 
> f.org_up) as org_up,
>IF(f.to_grid is null, f.to_cust, f.to_grid) to,
>IF(f.to_grid is null, 0, 1) as is_to_grid,
>IF(f.to_up is null, if(f.to_grid is null, f.to_cust, f.to_grid), f.to_up) 
> as to_up,
>gh.i_g_c as customer_code_hub,
>gs.i_g_c as customer_code_satellite
> from x_grid_orders f
> LEFT OUTER JOIN
>  grid.grid gh
>  ON f.org_grid = gh.hashed_gridid
> LEFT OUTER JOIN
>  grid.grid gs
>  ON f.to_grid = gs.hashed_gridid
> where
> IF(f.org_up is null, f.org_cust, f.org_up) <> IF(f.to_up is null, f.to_cust, 
> f.to_up)
>  AND
>  (substring(gh.i_g_c, 1, 2) <> "06" or gh.i_g_c is null)
>  AND
>  (substring(gs.i_g_c, 1, 2) <> "06" or gs.i_g_c is null)
>  AND
>  (gh.i_s_c <> "23" or gh.i_s_c is null)
>  AND
>  (gs.i_s_c <> "23" or gs.i_s_c is null)
> group by
>  f.dt,
>  f.t_c,
>  IF(f.org_grid is null, f.org_cust, f.org_grid),
>  IF(f.org_grid is null, 0, 1),
>  IF(f.org_up is null, if(f.org_grid is null, f.org_cust, f.org_grid), 
> f.org_up),
>  IF(f.to_grid is null, f.to_cust, f.to_grid),
>  IF(f.to_grid is null, 0, 1),
>  IF(f.to_up is null, if(f.to_grid is null, f.to_cust, f.to_grid), f.to_up),
>  gh.i_g_c,
>  gs.i_g_c



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-13136) Create index failed because index table not found.

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-13136?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-13136:
--
Component/s: (was: hpl/sql)

> Create index failed because index table not found.
> --
>
> Key: HIVE-13136
> URL: https://issues.apache.org/jira/browse/HIVE-13136
> Project: Hive
>  Issue Type: Bug
>  Components: Beeline
>Affects Versions: 1.2.1
>Reporter: Meng, Yongjian
>Assignee: Meng, Yongjian
>
> When I execute 
> CREATE INDEX y_key1_index ON TABLE y(key1) AS 
> 'org.apache.hadoop.hive.ql.index.compact.CompactIndexHandler' WITH DEFERRED 
> REBUILD;
> It always display an Error: Error while processing statement: FAILED: 
> Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. 
> Table not found default__y_y_key1_index__ (state=08S01,code=1)
> BUT in my hdfs, there exists the index table, but hive cannot load it when I 
> show tables.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Resolved] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko resolved HIVE-17024.
---
Resolution: Resolved

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Comment Edited] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-29 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko edited comment on HIVE-17024 at 8/29/17 5:37 PM:


Patch from HIVE-17025 resolves this ticket as well.


was (Author: dmtolpeko):
Patch from HIVE-17025 resolve this ticket as well.

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-29 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17024:
---

Patch from HIVE-17025 resolve this ticket as well.

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17025) HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to docs

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17025:
--
Fix Version/s: 3.0.0
   Status: Patch Available  (was: In Progress)

> HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to 
> docs
> -
>
> Key: HIVE-17025
> URL: https://issues.apache.org/jira/browse/HIVE-17025
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Fix For: 3.0.0
>
> Attachments: HIVE-17025.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Example from the docs is as follows:
> CREATE TABLE dept (
>   deptno NUMBER(2,0),
>   dname  NUMBER(14),
>   locVARCHAR2(13),
>   CONSTRAINT pk_dept PRIMARY KEY (deptno)
> );
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
> 
> I get this error:
> Caused by: java.lang.RuntimeException: 
> org.apache.hadoop.hive.ql.parse.ParseException:line 2:9 cannot recognize 
> input near 'NUMBER' '(' '2' in column type
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
>   
> hplsql.conn.convert.hiveconn
> true
>   
> 
> the example works.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Work started] (HIVE-17025) HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to docs

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on HIVE-17025 started by Dmitry Tolpeko.
-
> HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to 
> docs
> -
>
> Key: HIVE-17025
> URL: https://issues.apache.org/jira/browse/HIVE-17025
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17025.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Example from the docs is as follows:
> CREATE TABLE dept (
>   deptno NUMBER(2,0),
>   dname  NUMBER(14),
>   locVARCHAR2(13),
>   CONSTRAINT pk_dept PRIMARY KEY (deptno)
> );
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
> 
> I get this error:
> Caused by: java.lang.RuntimeException: 
> org.apache.hadoop.hive.ql.parse.ParseException:line 2:9 cannot recognize 
> input near 'NUMBER' '(' '2' in column type
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
>   
> hplsql.conn.convert.hiveconn
> true
>   
> 
> the example works.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17025) HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to docs

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17025:
--
Attachment: HIVE-17025.1.patch

> HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to 
> docs
> -
>
> Key: HIVE-17025
> URL: https://issues.apache.org/jira/browse/HIVE-17025
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17025.1.patch
>
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Example from the docs is as follows:
> CREATE TABLE dept (
>   deptno NUMBER(2,0),
>   dname  NUMBER(14),
>   locVARCHAR2(13),
>   CONSTRAINT pk_dept PRIMARY KEY (deptno)
> );
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
> 
> I get this error:
> Caused by: java.lang.RuntimeException: 
> org.apache.hadoop.hive.ql.parse.ParseException:line 2:9 cannot recognize 
> input near 'NUMBER' '(' '2' in column type
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
>   
> hplsql.conn.convert.hiveconn
> true
>   
> 
> the example works.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17026) HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master

2017-08-29 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17026?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17026:
-

Assignee: Dmitry Tolpeko  (was: Fei Hui)

> HPL/SQL Example for hplsql.conn.hiveconn doesn't work on master
> ---
>
> Key: HIVE-17026
> URL: https://issues.apache.org/jira/browse/HIVE-17026
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> The docs at http://www.hplsql.org/configuration#hplsqlconnhiveconn state:
> 
>   hplsql.conn.hiveconn
>   org.apache.hadoop.hive.jdbc.HiveDriver;jdbc:hive://
> 
> If you use that on current master you get:
> java.sql.SQLException: No suitable driver found for jdbc:hive://
> If you use hive2 it works fine. It's not clear to me if that's a change from 
> prior versions or not.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-29 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17024:
---

I was able to reproduce NPE working on HIVE-17025, it happens when DDL 
conversion is set to false on connection. I will create a patch. 

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-25 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17024:
---

For HiveServer2 embedded mode (jdbc:hive2://) I am going to remove the default 
initialization to use mr engine as it causes the program termination for some 
reason:

{code}
hplsql.conn.init.hiveconn
  
 set hive.execution.engine=mr; 
 use default;
  
{code}

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17025) HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to docs

2017-08-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17025:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: hplsql.conn.convert.hiveconn seems to default to false, contrary to 
> docs
> -
>
> Key: HIVE-17025
> URL: https://issues.apache.org/jira/browse/HIVE-17025
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> Example from the docs is as follows:
> CREATE TABLE dept (
>   deptno NUMBER(2,0),
>   dname  NUMBER(14),
>   locVARCHAR2(13),
>   CONSTRAINT pk_dept PRIMARY KEY (deptno)
> );
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
> 
> I get this error:
> Caused by: java.lang.RuntimeException: 
> org.apache.hadoop.hive.ql.parse.ParseException:line 2:9 cannot recognize 
> input near 'NUMBER' '(' '2' in column type
> With this config:
> 
>   
> hplsql.conn.default
> hiveconn
>   
>   
> hplsql.conn.hiveconn
> org.apache.hive.jdbc.HiveDriver;jdbc:hive2://
>   
>   
> hplsql.conn.convert.hiveconn
> true
>   
> 
> the example works.
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-25 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17024:
---

Asked Carter to add -trace and send me the results back as I cannot reproduce 
this. Here is my output:

{code}
Ln:1 CREATE TABLE
Ln:1 create table if not exists crtab_test1(col1 int)
17/08/25 15:31:05 INFO jdbc.Utils: Supplied authorities: localhost:1
17/08/25 15:31:05 INFO jdbc.Utils: Resolved authority: localhost:1
Open connection: jdbc:hive2://localhost:1 (568 ms)
Starting SQL statement
SQL statement executed successfully (395 ms)
Ln:2 CREATE TABLE
Ln:2 create table if not exists crtab_test2(col1 double)
Starting SQL statement
SQL statement executed successfully (505 ms)
Ln:3 CREATE TABLE
Ln:3 create table if not exists crtab_test3(col1 decimal(10, 4))
Starting SQL statement
SQL statement executed successfully (357 ms)
Ln:4 CREATE TABLE
Ln:4 create table if not exists crtab_test4(col1 string)
Starting SQL statement
SQL statement executed successfully (314 ms)
Ln:5 CREATE TABLE
Ln:5 create table if not exists crtab_test5(col1 varchar(20))
Starting SQL statement
SQL statement executed successfully (348 ms)
{code}

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> 

[jira] [Issue Comment Deleted] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17024:
--
Comment: was deleted

(was: After HIVE-16595 there is another error:
{code}
java.sql.SQLException: Error while compiling statement: FAILED: ParseException 
line 1:38 cannot recognize input near 'integer' ')' '' in column type
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:121)
{code}

Looks like EOF went to SQL string. )

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-25 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-17024:
---

After HIVE-16595 there is another error:
{code}
java.sql.SQLException: Error while compiling statement: FAILED: ParseException 
line 1:38 cannot recognize input near 'integer' ')' '' in column type
at org.apache.hive.jdbc.Utils.verifySuccess(Utils.java:121)
{code}

Looks like EOF went to SQL string. 

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17024) HPL/SQL: CLI fails to exit after NPE using embedded connection

2017-08-25 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17024?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17024:
-

Assignee: Dmitry Tolpeko

> HPL/SQL: CLI fails to exit after NPE using embedded connection
> --
>
> Key: HIVE-17024
> URL: https://issues.apache.org/jira/browse/HIVE-17024
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Reporter: Carter Shanklin
>Assignee: Dmitry Tolpeko
>Priority: Critical
>
> This bug is part of a series of issues and surprising behavior I encountered 
> writing a reporting script that would aggregate values and give rows 
> different classifications based on an the aggregate. Addressing some or all 
> of these issues would make HPL/SQL more accessible to newcomers.
> This happened during the error reported in XXX (bug TBD)
> Script is this:
> create table if not exists test1(col1 integer);
> create table if not exists test2(col1 double);
> create table if not exists test3(col1 decimal(10, 4));
> create table if not exists test4(col1 string);
> create table if not exists test5(col1 varchar(20));
> Output is this:
> [vagrant@trunk hplsql]$ hplsql -f temp3.sql
> SLF4J: Class path contains multiple SLF4J bindings.
> SLF4J: Found binding in 
> [jar:file:/home/vagrant/hivedist/apache-hive-3.0.0-SNAPSHOT-bin/lib/log4j-slf4j-impl-2.6.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: Found binding in 
> [jar:file:/usr/hdp/2.6.1.0-128/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
> SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an 
> explanation.
> SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
> Open connection: jdbc:hive2:// (5.83 sec)
> Starting query
> OK
> Query executed successfully (2.31 sec)
> Exception in thread "main" java.lang.NullPointerException
> at org.apache.hive.hplsql.Exec.evalPop(Exec.java:2398)
> at org.apache.hive.hplsql.Stmt.createTableDefinition(Stmt.java:169)
> at org.apache.hive.hplsql.Stmt.createTable(Stmt.java:142)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:1366)
> at org.apache.hive.hplsql.Exec.visitCreate_table_stmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$Create_table_stmtContext.accept(HplsqlParser.java:4198)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:1013)
> at org.apache.hive.hplsql.Exec.visitStmt(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$StmtContext.accept(HplsqlParser.java:1018)
> 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:452)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visitChildren(AbstractParseTreeVisitor.java:70)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:920)
> at org.apache.hive.hplsql.Exec.visitProgram(Exec.java:52)
> at 
> org.apache.hive.hplsql.HplsqlParser$ProgramContext.accept(HplsqlParser.java:393)
> at 
> org.antlr.v4.runtime.tree.AbstractParseTreeVisitor.visit(AbstractParseTreeVisitor.java:42)
> at org.apache.hive.hplsql.Exec.run(Exec.java:775)
> at org.apache.hive.hplsql.Exec.run(Exec.java:751)
> at org.apache.hive.hplsql.Hplsql.main(Hplsql.java:23)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:498)
> at org.apache.hadoop.util.RunJar.run(RunJar.java:233)
> at org.apache.hadoop.util.RunJar.main(RunJar.java:148)
> I attached a jstack.
> When I use a Hiveserver2 connection instead, I get an NPE but it doesn't hang 
> (at least not on the client side)
> Version = 3.0.0-SNAPSHOT r71f52d8ad512904b3f2c4f04fe39a33f2834f1f2



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-08-19 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17253:
--
Fix Version/s: 3.0.0
   Status: Patch Available  (was: Open)

> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
> Fix For: 3.0.0
>
> Attachments: HIVE-17253.1.patch
>
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy exploratory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-08-19 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17253:
--
Attachment: HIVE-17253.1.patch

> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
> Attachments: HIVE-17253.1.patch
>
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy exploratory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-08-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17253:
--
Description: 
Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
result) similar to Python and R.

For each column output the data type, number of distinct values, non-NULL rows, 
mean, std, percentiles, min, max. Output additional stats for categorical 
columns. This helps perform quick and easy exploratory data analysis for SQL 
devs and business users.  http://hplsql.org/summary

  was:
Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
result) similar to Python and R.

For each column output the data type, number of distinct values, non-NULL rows, 
mean, std, percentiles, min, max. Output additional stats for categorical 
columns. This helps perform quick and easy explanatory data analysis for SQL 
devs and business users.  http://hplsql.org/summary


> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy exploratory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Updated] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-08-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-17253:
--
Description: 
Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
result) similar to Python and R.

For each column output the data type, number of distinct values, non-NULL rows, 
mean, std, percentiles, min, max. Output additional stats for categorical 
columns. This helps perform quick and easy explanatory data analysis for SQL 
devs and business users.  http://hplsql.org/summary

  was:
Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
result) similar to Python and R.

For each column output the data type, number of distinct values, non-NULL rows, 
mean, std, percentiles, min, max. Output additional stats for categorical 
columns. This helps perform quick and easy explanatory data analysis for SQL 
devs and business users.   


> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy explanatory data 
> analysis for SQL devs and business users.  http://hplsql.org/summary



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Assigned] (HIVE-17253) Adding SUMMARY statement to HPL/SQL

2017-08-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-17253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko reassigned HIVE-17253:
-


> Adding SUMMARY statement to HPL/SQL
> ---
>
> Key: HIVE-17253
> URL: https://issues.apache.org/jira/browse/HIVE-17253
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Dmitry Tolpeko
>Assignee: Dmitry Tolpeko
>
> Adding SUMMARY statement to HPL/SQL to describe a data set (table, query 
> result) similar to Python and R.
> For each column output the data type, number of distinct values, non-NULL 
> rows, mean, std, percentiles, min, max. Output additional stats for 
> categorical columns. This helps perform quick and easy explanatory data 
> analysis for SQL devs and business users.   



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)


[jira] [Commented] (HIVE-15096) hplsql registerUDF conflicts with pom.xml

2016-11-01 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-15096:
---

+1 looks good, thanks.

> hplsql registerUDF conflicts with pom.xml
> -
>
> Key: HIVE-15096
> URL: https://issues.apache.org/jira/browse/HIVE-15096
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.0, 2.1.0, 2.0.1
>Reporter: Fei Hui
> Fix For: 2.2.0
>
> Attachments: HIVE-15096.1.patch, HIVE-15096.patch
>
>
> in hplsql code, registerUDF code is
> sql.add("ADD JAR " + dir + "hplsql.jar");
> sql.add("ADD JAR " + dir + "antlr-runtime-4.5.jar");
> sql.add("ADD FILE " + dir + Conf.SITE_XML);
> but pom configufation is
>   
> org.apache.hive
> hive
> 2.2.0-SNAPSHOT
> ../pom.xml
>   
>   hive-hplsql
>   jar
>   Hive HPL/SQL
> 
>org.antlr
>antlr4-runtime
>4.5
> 
> when run hplsql , errors occur as below
>  Error while processing statement: 
> /opt/apps/apache-hive-2.0.0-bin/lib/hplsql.jar does not exist



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


[jira] [Commented] (HIVE-15096) hplsql registerUDF conflicts with pom.xml

2016-10-31 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-15096:
---

-1 why to hardcode the version hive-hplsql-2.2.0-SNAPSHOT.jar 
you will need to change this file with every Hive realease.

> hplsql registerUDF conflicts with pom.xml
> -
>
> Key: HIVE-15096
> URL: https://issues.apache.org/jira/browse/HIVE-15096
> Project: Hive
>  Issue Type: Bug
>  Components: hpl/sql
>Affects Versions: 2.0.0, 2.1.0, 2.0.1
>Reporter: Fei Hui
> Fix For: 2.2.0
>
> Attachments: HIVE-15096.patch
>
>
> in hplsql code, registerUDF code is
> sql.add("ADD JAR " + dir + "hplsql.jar");
> sql.add("ADD JAR " + dir + "antlr-runtime-4.5.jar");
> sql.add("ADD FILE " + dir + Conf.SITE_XML);
> but pom configufation is
>   
> org.apache.hive
> hive
> 2.2.0-SNAPSHOT
> ../pom.xml
>   
>   hive-hplsql
>   jar
>   Hive HPL/SQL
> 
>org.antlr
>antlr4-runtime
>4.5
> 
> when run hplsql , errors occur as below
>  Error while processing statement: 
> /opt/apps/apache-hive-2.0.0-bin/lib/hplsql.jar does not exist



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


[jira] [Commented] (HIVE-14382) Improve the Functionality of Reverse FOR Statement

2016-08-04 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14382:
---

Patch committed. 

> Improve the Functionality of Reverse  FOR Statement
> ---
>
> Key: HIVE-14382
> URL: https://issues.apache.org/jira/browse/HIVE-14382
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Akash Sethi
>Assignee: Akash Sethi
>Priority: Minor
> Fix For: 2.2.0
>
> Attachments: HIVE-14382.1-branch-2.1.patch, HIVE-14382.1.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> According to SQL Standards, Reverse FOR Statement should be like this:-
> FOR index IN Optional[Reverse] Lower_Bound Upper_Bound
> but in hive it is like this :- 
> FOR index IN Optional[Reverse]  Upper_Bound Lower_Bound
> so i m just trying to improve the functionality for Reverse FOR Statement
> REFERNCES :- 
> https://docs.oracle.com/cloud/latest/db112/LNPLS/for_loop_statement.htm#LNPLS1536



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


[jira] [Updated] (HIVE-14382) Improve the Functionality of Reverse FOR Statement

2016-08-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-14382:
--
   Resolution: Fixed
Fix Version/s: 2.2.0
   Status: Resolved  (was: Patch Available)

> Improve the Functionality of Reverse  FOR Statement
> ---
>
> Key: HIVE-14382
> URL: https://issues.apache.org/jira/browse/HIVE-14382
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Akash Sethi
>Assignee: Akash Sethi
>Priority: Minor
> Fix For: 2.2.0
>
> Attachments: HIVE-14382.1-branch-2.1.patch, HIVE-14382.1.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> According to SQL Standards, Reverse FOR Statement should be like this:-
> FOR index IN Optional[Reverse] Lower_Bound Upper_Bound
> but in hive it is like this :- 
> FOR index IN Optional[Reverse]  Upper_Bound Lower_Bound
> so i m just trying to improve the functionality for Reverse FOR Statement
> REFERNCES :- 
> https://docs.oracle.com/cloud/latest/db112/LNPLS/for_loop_statement.htm#LNPLS1536



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


[jira] [Commented] (HIVE-14382) Improve the Functionality of Reverse FOR Statement

2016-08-04 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14382:
---

Reviewed and updated docs.

> Improve the Functionality of Reverse  FOR Statement
> ---
>
> Key: HIVE-14382
> URL: https://issues.apache.org/jira/browse/HIVE-14382
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Akash Sethi
>Assignee: Akash Sethi
>Priority: Minor
> Attachments: HIVE-14382.1-branch-2.1.patch, HIVE-14382.1.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> According to SQL Standards, Reverse FOR Statement should be like this:-
> FOR index IN Optional[Reverse] Lower_Bound Upper_Bound
> but in hive it is like this :- 
> FOR index IN Optional[Reverse]  Upper_Bound Lower_Bound
> so i m just trying to improve the functionality for Reverse FOR Statement
> REFERNCES :- 
> https://docs.oracle.com/cloud/latest/db112/LNPLS/for_loop_statement.htm#LNPLS1536



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


[jira] [Updated] (HIVE-14382) Improve the Functionality of Reverse FOR Statement

2016-08-04 Thread Dmitry Tolpeko (JIRA)

 [ 
https://issues.apache.org/jira/browse/HIVE-14382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Dmitry Tolpeko updated HIVE-14382:
--
Component/s: hpl/sql

> Improve the Functionality of Reverse  FOR Statement
> ---
>
> Key: HIVE-14382
> URL: https://issues.apache.org/jira/browse/HIVE-14382
> Project: Hive
>  Issue Type: Improvement
>  Components: hpl/sql
>Reporter: Akash Sethi
>Assignee: Akash Sethi
>Priority: Minor
> Attachments: HIVE-14382.1-branch-2.1.patch, HIVE-14382.1.patch
>
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> According to SQL Standards, Reverse FOR Statement should be like this:-
> FOR index IN Optional[Reverse] Lower_Bound Upper_Bound
> but in hive it is like this :- 
> FOR index IN Optional[Reverse]  Upper_Bound Lower_Bound
> so i m just trying to improve the functionality for Reverse FOR Statement
> REFERNCES :- 
> https://docs.oracle.com/cloud/latest/db112/LNPLS/for_loop_statement.htm#LNPLS1536



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


[jira] [Commented] (HIVE-14382) Improve the Functionality of Reverse FOR Statement

2016-07-29 Thread Dmitry Tolpeko (JIRA)

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

Dmitry Tolpeko commented on HIVE-14382:
---

Akash, right now this functionality is part of Hive HPL/SQL component, see 
docs: http://hplsql.org/for-range

> Improve the Functionality of Reverse  FOR Statement
> ---
>
> Key: HIVE-14382
> URL: https://issues.apache.org/jira/browse/HIVE-14382
> Project: Hive
>  Issue Type: Improvement
>Reporter: Akash Sethi
>Assignee: Akash Sethi
>Priority: Minor
>   Original Estimate: 0.5h
>  Remaining Estimate: 0.5h
>
> According to SQL Standards, Reverse FOR Statement should be like this:-
> FOR index IN Optional[Reverse] Lower_Bound Upper_Bound
> but in hive it is like this :- 
> FOR index IN Optional[Reverse]  Upper_Bound Lower_Bound
> so i m just trying to improve the functionality for Reverse FOR Statement
> REFERNCES :- 
> https://docs.oracle.com/cloud/latest/db112/LNPLS/for_loop_statement.htm#LNPLS1536



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


  1   2   >