[jira] [Created] (HIVE-22233) Wrong result with vectorized execution when column value is casted to TINYINT

2019-09-23 Thread Ganesha Shreedhara (Jira)
Ganesha Shreedhara created HIVE-22233:
-

 Summary: Wrong result with vectorized execution when column value 
is casted to TINYINT
 Key: HIVE-22233
 URL: https://issues.apache.org/jira/browse/HIVE-22233
 Project: Hive
  Issue Type: Bug
Affects Versions: 3.1.1
Reporter: Ganesha Shreedhara


Casting a column value to TINYINT is giving incorrect result when vectorized 
execution is enabled. This is only when the sub query as SUM/COUNT aggregation 
operations in IF condition.  

*Steps to reproduce:*

 
{code:java}
create table test(id int);
insert into test values (1);
SELECT CAST(col AS TINYINT) col_cast FROM ( SELECT IF(SUM(1) > 0, 1, 0) col 
FROM test) x;
{code}
 

*Result:*
{code:java}
0{code}
*Expected result:*
{code:java}
1{code}
 

We get the expected result when hive.vectorized.execution.enabled is disabled. 

We also get the expected result when we don't CAST or don't have SUM/COUNT 
aggregation in IF condition.

The following queries give correct result when vectorized execution is enabled. 
 

 

 
{code:java}
SELECT CAST(col AS INT) col_cast FROM ( SELECT IF(SUM(1) > 0, 1, 0) col FROM 
test) x;
SELECT col FROM ( SELECT IF(SUM(1) > 0, 1, 0) col FROM test) x;
SELECT CAST(col AS INT) col_cast FROM ( SELECT IF(2 > 1, 1, 0) col FROM test) x;
SELECT CAST(col AS INT) col_cast FROM ( SELECT IF(true, 1, 0) col FROM test) x;
{code}
 

 

This issue is only when we use *CAST(col AS TINYINT)* along with *IF(SUM(1) > 
0, 1, 0) or IF(COUNT(1) > 0, 1, 0)* in sub query. 

 

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (HIVE-22232) NPE when hive.order.columnalignment is set to false

2019-09-23 Thread Jesus Camacho Rodriguez (Jira)
Jesus Camacho Rodriguez created HIVE-22232:
--

 Summary: NPE when hive.order.columnalignment is set to false
 Key: HIVE-22232
 URL: https://issues.apache.org/jira/browse/HIVE-22232
 Project: Hive
  Issue Type: Bug
  Components: CBO
Reporter: Jesus Camacho Rodriguez
Assignee: Jesus Camacho Rodriguez


When {{hive.order.columnalignment}} is disabled and the plan contains an 
Aggregate operator, we hit a NPE.

{code}
 java.lang.NullPointerException
at 
org.apache.hadoop.hive.ql.optimizer.calcite.translator.ASTConverter.convert(ASTConverter.java:163)
at 
org.apache.hadoop.hive.ql.optimizer.calcite.translator.ASTConverter.convert(ASTConverter.java:111)
at 
org.apache.hadoop.hive.ql.parse.CalcitePlanner.getOptimizedAST(CalcitePlanner.java:1555)
at 
org.apache.hadoop.hive.ql.parse.CalcitePlanner.genOPTree(CalcitePlanner.java:483)
at 
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal(SemanticAnalyzer.java:12630)
at 
org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal(CalcitePlanner.java:357)
at 
org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:285)
at 
org.apache.hadoop.hive.ql.parse.ExplainSemanticAnalyzer.analyzeInternal(ExplainSemanticAnalyzer.java:175)
at 
org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze(BaseSemanticAnalyzer.java:285)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:522)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1385)
at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1332)
at org.apache.hadoop.hive.ql.Driver.compileAndRespond(Driver.java:1327)
at 
org.apache.hadoop.hive.ql.reexec.ReExecDriver.compileAndRespond(ReExecDriver.java:124)
at 
org.apache.hadoop.hive.ql.reexec.ReExecDriver.run(ReExecDriver.java:217)
at 
org.apache.hadoop.hive.cli.CliDriver.processLocalCmd(CliDriver.java:242)
...
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Created] (HIVE-22231) Hive query with big size via knox fails with 'Broken pipe (Write failed)

2019-09-23 Thread Denys Kuzmenko (Jira)
Denys Kuzmenko created HIVE-22231:
-

 Summary: Hive query with big size via knox fails with 'Broken pipe 
(Write failed)
 Key: HIVE-22231
 URL: https://issues.apache.org/jira/browse/HIVE-22231
 Project: Hive
  Issue Type: Bug
Reporter: Denys Kuzmenko


When a big query is being passed to HS2, HS2 has to wait for complete query 
before responding with 401. Once knox receives 401, it will send next request 
with negotiate header. 

Issue here that HS2 is responding with 401 even before complete query is 
transferred. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Review Request 71506: HIVE-22084: Implement exchange partitions related methods on temporary tables.

2019-09-23 Thread Laszlo Pinter via Review Board


> On Sept. 23, 2019, 11:34 a.m., Peter Vary wrote:
> > Thanks Laszlo!
> > Few quick questions below.
> > We might want to test the cross exchange methods as well (exchange 
> > partition between temp and non-temp tables)
> > 
> > Otherwise LGTM

Thanks Peter for the review, highly appreciate it! I addressed all the review 
findings and added a couple more test to cover the mentioned scenario as well.


- Laszlo


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71506/#review217910
---


On Sept. 18, 2019, 2:10 p.m., Laszlo Pinter wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71506/
> ---
> 
> (Updated Sept. 18, 2019, 2:10 p.m.)
> 
> 
> Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> HIVE-22084: Implement exchange partitions related methods on temporary tables.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
>  506bf5dfa8404f3645b8c5db7ea19c0b4add33a7 
>   
> ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientExchangePartitionsTempTable.java
>  PRE-CREATION 
>   
> standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestExchangePartitions.java
>  1a2b7e4f9f7562e84006e86061b482d1b535197c 
> 
> 
> Diff: https://reviews.apache.org/r/71506/diff/4/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Laszlo Pinter
> 
>



[jira] [Created] (HIVE-22230) Add support for filtering partitions on temporary tables

2019-09-23 Thread Laszlo Pinter (Jira)
Laszlo Pinter created HIVE-22230:


 Summary: Add support for filtering partitions on temporary tables
 Key: HIVE-22230
 URL: https://issues.apache.org/jira/browse/HIVE-22230
 Project: Hive
  Issue Type: Task
  Components: Hive
Reporter: Laszlo Pinter
Assignee: Laszlo Pinter


We need support for filtering partitions on temporary tables. In order to 
achieve this, SessionHiveMetastoreClient must implement the following methods:
{code:java}
public List listPartitionsByFilter(String catName, String dbName, 
String tableName,String filter, int maxParts)
public int getNumPartitionsByFilter(String catName, String dbName, String 
tableName, String filter)
public PartitionSpecProxy listPartitionSpecsByFilter(String catName, String 
dbName, String tblName, String filter, int maxParts)
public PartitionValuesResponse listPartitionValues(PartitionValuesRequest 
request)
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


Re: Review Request 71506: HIVE-22084: Implement exchange partitions related methods on temporary tables.

2019-09-23 Thread Peter Vary via Review Board

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/71506/#review217910
---



Thanks Laszlo!
Few quick questions below.
We might want to test the cross exchange methods as well (exchange partition 
between temp and non-temp tables)

Otherwise LGTM


ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
Lines 1580 (patched)


What is the error message when we want to exchange partition between a temp 
table and a normal table? Maybe we want to have a specific error message 
instead?



ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
Lines 1601 (patched)


What is the error message when we want to exchange partition between a temp 
table and a normal table? Maybe we want to have a specific error message 
instead?



ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
Lines 1652-1653 (patched)


Why are we doing it in 2 steps?


- Peter Vary


On szept. 18, 2019, 2:10 du, Laszlo Pinter wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71506/
> ---
> 
> (Updated szept. 18, 2019, 2:10 du)
> 
> 
> Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> HIVE-22084: Implement exchange partitions related methods on temporary tables.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
>  506bf5dfa8404f3645b8c5db7ea19c0b4add33a7 
>   
> ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientExchangePartitionsTempTable.java
>  PRE-CREATION 
>   
> standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestExchangePartitions.java
>  1a2b7e4f9f7562e84006e86061b482d1b535197c 
> 
> 
> Diff: https://reviews.apache.org/r/71506/diff/3/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Laszlo Pinter
> 
>