[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-30 Thread ASF GitHub Bot (Jira)


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

ASF GitHub Bot updated HIVE-27164:
--
Labels: pull-request-available  (was: )

> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Assignee: Venugopal Reddy K
>Priority: Major
>  Labels: pull-request-available
> Attachments: mm_cttas.q
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
>         at 
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
> I am able to repro this issue using attached testcase. [^mm_cttas.q]
>  
> There are multiple ways to fix this issue
>  * Have temp txn table path under db's managed location path. This will help 
> with encryption zone paths as well.
>  * Skip location check for temp tables at 
> MetastoreDefaultTransformer#validateTablePaths()



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-21 Thread Naresh P R (Jira)


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

Naresh P R updated HIVE-27164:
--
Description: 
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue using attached testcase. [^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone paths as well.
 * Skip location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()

  was:
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone paths as well.
 * Skip location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()


> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Priority: Major
> Attachments: mm_cttas.q
>
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
> 

[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-21 Thread Naresh P R (Jira)


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

Naresh P R updated HIVE-27164:
--
Description: 
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone paths as well.
 * Skip location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()

  was:
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone tables as well.
 * Skip location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()


> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Priority: Major
> Attachments: mm_cttas.q
>
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
> 

[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-21 Thread Naresh P R (Jira)


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

Naresh P R updated HIVE-27164:
--
Attachment: mm_cttas.q

> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Priority: Major
> Attachments: mm_cttas.q
>
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
>         at 
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
>         at 
> org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
> I am able to repro this issue at apache upstream using attached testcase.
>  
> There are multiple ways to fix this issue
>  * Have temp txn table path under db's managed location path. This will help 
> with encryption zone tables as well.
>  * skips location check for temp tables at 
> MetastoreDefaultTransformer#validateTablePaths()



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-21 Thread Naresh P R (Jira)


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

Naresh P R updated HIVE-27164:
--
Description: 
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone tables as well.
 * skips location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()

  was:
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase.

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone tables as well.
 * skips location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()


> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Priority: Major
> Attachments: mm_cttas.q
>
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
> 

[jira] [Updated] (HIVE-27164) Create Temp Txn Table As Select is failing at tablePath validation

2023-03-21 Thread Naresh P R (Jira)


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

Naresh P R updated HIVE-27164:
--
Description: 
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone tables as well.
 * Skip location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()

  was:
After HIVE-25303, every CTAS goes for  
HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table location 
for CTAS queries which fails with following exception for temp tables if 
MetastoreDefaultTransformer is set.
{code:java}
2023-03-17 16:41:23,390 INFO  
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
[pool-6-thread-196]: Starting translation for CreateTable for processor 
HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
HIVEONLYMQTWRITE] on table test_temp
2023-03-17 16:41:23,392 ERROR 
org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
MetaException(message:Illegal location for managed table, it has to be within 
database's managed location)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.validateTablePaths(MetastoreDefaultTransformer.java:886)
        at 
org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer.transformCreateTable(MetastoreDefaultTransformer.java:666)
        at 
org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.translate_table_dryrun(HiveMetaStore.java:2164)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) {code}
I am able to repro this issue at apache upstream using attached testcase. 
[^mm_cttas.q]

 

There are multiple ways to fix this issue
 * Have temp txn table path under db's managed location path. This will help 
with encryption zone tables as well.
 * skips location check for temp tables at 
MetastoreDefaultTransformer#validateTablePaths()


> Create Temp Txn Table As Select is failing at tablePath validation
> --
>
> Key: HIVE-27164
> URL: https://issues.apache.org/jira/browse/HIVE-27164
> Project: Hive
>  Issue Type: Bug
>  Components: HiveServer2, Metastore
>Reporter: Naresh P R
>Priority: Major
> Attachments: mm_cttas.q
>
>
> After HIVE-25303, every CTAS goes for  
> HiveMetaStore$HMSHandler#translate_table_dryrun() call to fetch table 
> location for CTAS queries which fails with following exception for temp 
> tables if MetastoreDefaultTransformer is set.
> {code:java}
> 2023-03-17 16:41:23,390 INFO  
> org.apache.hadoop.hive.metastore.MetastoreDefaultTransformer: 
> [pool-6-thread-196]: Starting translation for CreateTable for processor 
> HMSClient-@localhost with [EXTWRITE, EXTREAD, HIVEBUCKET2, HIVEFULLACIDREAD, 
> HIVEFULLACIDWRITE, HIVECACHEINVALIDATE, HIVEMANAGESTATS, 
> HIVEMANAGEDINSERTWRITE, HIVEMANAGEDINSERTREAD, HIVESQL, HIVEMQT, 
> HIVEONLYMQTWRITE] on table test_temp
> 2023-03-17 16:41:23,392 ERROR 
> org.apache.hadoop.hive.metastore.RetryingHMSHandler: [pool-6-thread-196]: 
> MetaException(message:Illegal location for managed table, it has to be within 
> database's managed location)
>         at 
>