[jira] [Created] (HIVE-22209) Creating a materialized view with no tables should be handled more gracefully

2019-09-16 Thread Jesus Camacho Rodriguez (Jira)
Jesus Camacho Rodriguez created HIVE-22209:
--

 Summary: Creating a materialized view with no tables should be 
handled more gracefully
 Key: HIVE-22209
 URL: https://issues.apache.org/jira/browse/HIVE-22209
 Project: Hive
  Issue Type: Bug
  Components: Materialized views
Reporter: Jesus Camacho Rodriguez
Assignee: John Sherman


Currently, materialized views without a table reference are not supported. 
However, instead of printing a clear message about it, when a materialized view 
is created without a table reference, we fail with an unclear message.

{code}
> create materialized view mv_test1 as select 5;
(...)
ERROR : FAILED: Execution Error, return code 1 from 
org.apache.hadoop.hive.ql.exec.DDLTask. MetaException(message:Add request 
failed :
INSERT INTO MV_TABLES_USED (MV_CREATION_METADATA_ID,TBL_ID) VALUES (?,?) )
INFO : Completed executing 
command(queryId=hive_20190916203511_b609cccf-f5e3-45dd-abfd-6e869d94e39a); Time 
taken: 10.469 seconds
Error: Error while processing statement: FAILED: Execution Error, return code 1 
from org.apache.hadoop.hive.ql.exec.DDLTask. MetaExcep
tion(message:Add request failed : INSERT INTO MV_TABLES_USED 
(MV_CREATION_METADATA_ID,TBL_ID) VALUES (?,?) ) (state=08S01,code=1)
{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)


Re: Review Request 71243: HIVE-21875: Implement drop partition related methods on temporary tables.

2019-09-16 Thread Laszlo Pinter via Review Board


> On Sept. 16, 2019, 11:24 a.m., Gergely Hankó wrote:
> > ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
> > Lines 948-952 (patched)
> > 
> >
> > This can be simplified to:
> > `return tableParameters != null && 
> > "true".equals(tableParameters.get(EXTERNAL_PARAM));`
> > 
> > It is more compact and also spares a query on the map.

Did the change. Thanks for the review.


- Laszlo


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


On Sept. 16, 2019, 12:39 p.m., Laszlo Pinter wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71243/
> ---
> 
> (Updated Sept. 16, 2019, 12:39 p.m.)
> 
> 
> Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> HIVE-21875: Implement drop partition related methods on temporary tables.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
>  a2c84b4620fb1eb90069e294204f604565ffed9b 
>   
> ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java
>  PRE-CREATION 
>   
> standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDropPartitions.java
>  91c9edac95e9f9688dd2b806aeeb0823af02574f 
> 
> 
> Diff: https://reviews.apache.org/r/71243/diff/2/
> 
> 
> Testing
> ---
> 
> Unit testing is done via 
> TestSessionHiveMetastoreClientDropPartitionsTempTable.java
> 
> 
> Thanks,
> 
> Laszlo Pinter
> 
>



Re: Review Request 71243: HIVE-21875: Implement drop partition related methods on temporary tables.

2019-09-16 Thread Laszlo Pinter via Review Board

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

(Updated Sept. 16, 2019, 12:39 p.m.)


Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.


Repository: hive-git


Description (updated)
---

HIVE-21875: Implement drop partition related methods on temporary tables.


Diffs (updated)
-

  
ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java 
a2c84b4620fb1eb90069e294204f604565ffed9b 
  
ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java
 PRE-CREATION 
  
standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDropPartitions.java
 91c9edac95e9f9688dd2b806aeeb0823af02574f 


Diff: https://reviews.apache.org/r/71243/diff/2/

Changes: https://reviews.apache.org/r/71243/diff/1-2/


Testing
---

Unit testing is done via 
TestSessionHiveMetastoreClientDropPartitionsTempTable.java


Thanks,

Laszlo Pinter



Re: Review Request 71243: HIVE-21875: Implement drop partition related methods on temporary tables.

2019-09-16 Thread Gergely Hankó via Review Board

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




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


This can be simplified to:
`return tableParameters != null && 
"true".equals(tableParameters.get(EXTERNAL_PARAM));`

It is more compact and also spares a query on the map.


- Gergely Hankó


On aug. 7, 2019, 8:35 de, Laszlo Pinter wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71243/
> ---
> 
> (Updated aug. 7, 2019, 8:35 de)
> 
> 
> Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> HIVE-21875: Implement drop partition related methods on temporary tables.
> 
> This is one of the subtasks for HIVE-21765, to support partitions on 
> temporary tables.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
>  a2c84b4620fb1eb90069e294204f604565ffed9b 
>   
> ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java
>  PRE-CREATION 
>   
> service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
>  129413681045d790ae20bf4d8060f04162224565 
>   
> standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDropPartitions.java
>  91c9edac95e9f9688dd2b806aeeb0823af02574f 
> 
> 
> Diff: https://reviews.apache.org/r/71243/diff/1/
> 
> 
> Testing
> ---
> 
> Unit testing is done via 
> TestSessionHiveMetastoreClientDropPartitionsTempTable.java
> 
> 
> Thanks,
> 
> Laszlo Pinter
> 
>



Re: Review Request 71243: HIVE-21875: Implement drop partition related methods on temporary tables.

2019-09-16 Thread Peter Vary via Review Board

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



Fix it and ship it


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


Please move these check after the assertTempTablePartitioned



ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java
Lines 139-144 (patched)


Please ensure that for Temp table we are working in the same way than for 
normal tables



service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
Line 57 (original)


Please check this change


- Peter Vary


On aug. 7, 2019, 8:35 de, Laszlo Pinter wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/71243/
> ---
> 
> (Updated aug. 7, 2019, 8:35 de)
> 
> 
> Review request for hive, Marta Kuczora, Peter Vary, and Adam Szita.
> 
> 
> Repository: hive-git
> 
> 
> Description
> ---
> 
> HIVE-21875: Implement drop partition related methods on temporary tables.
> 
> This is one of the subtasks for HIVE-21765, to support partitions on 
> temporary tables.
> 
> 
> Diffs
> -
> 
>   
> ql/src/java/org/apache/hadoop/hive/ql/metadata/SessionHiveMetaStoreClient.java
>  a2c84b4620fb1eb90069e294204f604565ffed9b 
>   
> ql/src/test/org/apache/hadoop/hive/ql/metadata/TestSessionHiveMetastoreClientDropPartitionsTempTable.java
>  PRE-CREATION 
>   
> service/src/java/org/apache/hive/service/cli/thrift/ThreadPoolExecutorWithOomHook.java
>  129413681045d790ae20bf4d8060f04162224565 
>   
> standalone-metastore/metastore-server/src/test/java/org/apache/hadoop/hive/metastore/client/TestDropPartitions.java
>  91c9edac95e9f9688dd2b806aeeb0823af02574f 
> 
> 
> Diff: https://reviews.apache.org/r/71243/diff/1/
> 
> 
> Testing
> ---
> 
> Unit testing is done via 
> TestSessionHiveMetastoreClientDropPartitionsTempTable.java
> 
> 
> Thanks,
> 
> Laszlo Pinter
> 
>



[jira] [Created] (HIVE-22208) Column name with reserved keyword is unescaped when query includes join on table with mask column is re-written

2019-09-16 Thread Riju Trivedi (Jira)
Riju Trivedi created HIVE-22208:
---

 Summary: Column name with reserved keyword is unescaped when query 
includes join on table with mask column is re-written
 Key: HIVE-22208
 URL: https://issues.apache.org/jira/browse/HIVE-22208
 Project: Hive
  Issue Type: Bug
  Components: Hive
Affects Versions: 3.1.0, 4.0.0
Reporter: Riju Trivedi


Join query  involving table with mask column and  other having reserved keyword 
as column name fails with SemanticException during parsing re-written query :

Original Query :
{code:java}
select a.`date`, b.nm
from sample_keyword a
join sample_mask b
on b.id = a.id;
{code}
Re-written Query :
 
{code:java}
select a.date, b.nm
from sample_keyword a
join (SELECT `id`, CAST(mask_hash(nm) AS string) AS `nm`, 
BLOCK__OFFSET__INSIDE__FILE, INPUT__FILE__NAME, ROW__ID FROM 
`default`.`sample_mask` )`b`
on b.id = a.id;
{code}
Re-written query does not have escape quotes for date column which cause 
SemanticException while parsing :
 
 
{code:java}
org.apache.hadoop.hive.ql.parse.ParseException: line 1:9 cannot recognize input 
near 'a' '.' 'date' in selection target 
   

at 
org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.rewriteASTWithMaskAndFilter( 
SemanticAnalyzer.java:12084)
at org.apache.hadoop.hive.ql.parse.SemanticAnalyzer.analyzeInternal( 
SemanticAnalyzer.java:12298)
at org.apache.hadoop.hive.ql.parse.CalcitePlanner.analyzeInternal( 
CalcitePlanner.java:360)
at org.apache.hadoop.hive.ql.parse.BaseSemanticAnalyzer.analyze( 
BaseSemanticAnalyzer.java:289)
at org.apache.hadoop.hive.ql.Driver.compile(Driver.java:664)
at org.apache.hadoop.hive.ql.Driver.compileInternal(Driver.java:1869)
{code}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)