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

Marcus T updated HIVE-15729:
----------------------------
    Description: 
When using CREATE TEMPORARY TABLE with a LOCATION clause, Hive doesn't remove 
the created files when the session ends.

Steps to reproduce:

{noformat}
beeline
  CREATE TEMPORARY TABLE this_gets_removed AS SELECT 'OK';
  CREATE TEMPORARY TABLE this_stays LOCATION '/tmp/this_stays' AS SELECT 'BAD';
  !quit

hdfs dfs -ls -R "/tmp/hive/${USER}" "/tmp/this_stays"
{noformat}

Expected result: files and directories for {{this_gets_removed}} and 
{{this_stays}} are removed.
Actual result: files and directories for {{this_gets_removed}} are removed, 
files and directories for {{this_stays}} are still present.

Ideally, it would be great if the LOCATION clause worked with the TEMPORARY 
clause.  If they can't be made to work together, perhaps the LOCATION clause 
should be illegal when using TEMPORARY.

  was:
When using CREATE TEMPORARY TABLE with a LOCATION clause, Hive doesn't remove 
the created files when the session ends.

Steps to reproduce:
    beeline
      CREATE TEMPORARY TABLE this_gets_removed AS SELECT 'OK';
      CREATE TEMPORARY TABLE this_stays LOCATION '/tmp/this_stays' AS SELECT 
'BAD';
      !quit

    hdfs dfs -ls -R "/tmp/hive/${USER}" "/tmp/this_stays"

Expected result: files and directories for `this_gets_removed` and `this_stays` 
are removed.
Actual result: files and directories for `this_gets_removed` are removed, files 
and directories for `this_stays` are still present.

Ideally, it would be great if the LOCATION clause worked with the TEMPORARY 
clause.  If they can't be made to work together, perhaps the LOCATION clause 
should be illegal when using TEMPORARY.


> Temporary table with LOCATION clause not removed after session ends
> -------------------------------------------------------------------
>
>                 Key: HIVE-15729
>                 URL: https://issues.apache.org/jira/browse/HIVE-15729
>             Project: Hive
>          Issue Type: Bug
>            Reporter: Marcus T
>            Priority: Minor
>
> When using CREATE TEMPORARY TABLE with a LOCATION clause, Hive doesn't remove 
> the created files when the session ends.
> Steps to reproduce:
> {noformat}
> beeline
>   CREATE TEMPORARY TABLE this_gets_removed AS SELECT 'OK';
>   CREATE TEMPORARY TABLE this_stays LOCATION '/tmp/this_stays' AS SELECT 
> 'BAD';
>   !quit
> hdfs dfs -ls -R "/tmp/hive/${USER}" "/tmp/this_stays"
> {noformat}
> Expected result: files and directories for {{this_gets_removed}} and 
> {{this_stays}} are removed.
> Actual result: files and directories for {{this_gets_removed}} are removed, 
> files and directories for {{this_stays}} are still present.
> Ideally, it would be great if the LOCATION clause worked with the TEMPORARY 
> clause.  If they can't be made to work together, perhaps the LOCATION clause 
> should be illegal when using TEMPORARY.



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

Reply via email to