Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 6471D200C7F for ; Wed, 10 May 2017 07:29:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 633ED160BB6; Wed, 10 May 2017 05:29:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A8DF8160BC8 for ; Wed, 10 May 2017 07:29:09 +0200 (CEST) Received: (qmail 51595 invoked by uid 500); 10 May 2017 05:29:08 -0000 Mailing-List: contact issues-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list issues@hive.apache.org Received: (qmail 51424 invoked by uid 99); 10 May 2017 05:29:08 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 May 2017 05:29:08 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id F3202CB1D2 for ; Wed, 10 May 2017 05:29:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id j9gNnmiVbrMY for ; Wed, 10 May 2017 05:29:07 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 70BE15F4EE for ; Wed, 10 May 2017 05:29:06 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 8B133E002A for ; Wed, 10 May 2017 05:29:05 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 7803421E1C for ; Wed, 10 May 2017 05:29:04 +0000 (UTC) Date: Wed, 10 May 2017 05:29:04 +0000 (UTC) From: "Ashutosh Chauhan (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-16324) Truncate table should not work when EXTERNAL property of table is true MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 10 May 2017 05:29:10 -0000 [ https://issues.apache.org/jira/browse/HIVE-16324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16004095#comment-16004095 ] Ashutosh Chauhan commented on HIVE-16324: ----------------------------------------- Sql is suppose to be case insensitive, so current behavior I think is buggy and should be correct. [~thejas] Any comments? > Truncate table should not work when EXTERNAL property of table is true > ---------------------------------------------------------------------- > > Key: HIVE-16324 > URL: https://issues.apache.org/jira/browse/HIVE-16324 > Project: Hive > Issue Type: Bug > Reporter: Vihang Karajgaonkar > Assignee: Vihang Karajgaonkar > > Currently if you create an external table using the command {{CREATE EXTERNAL TABLE table_name}} the {{TRUNCATE table table_name}} command fails as expected because only managed tables should be allowed to be truncated. > But if you set the external property of a previously managed table using {{ALTER TABLE table_name SET TBLPROPERTIES('EXTERNAL'='true')}}, truncate table command does not object and deletes all the data from the external table. > Eg: This works but it should not .. > {noformat} > 0: jdbc:hive2://localhost:10000/default> create table test_ext2 (col1 string); > No rows affected (0.424 seconds) > 0: jdbc:hive2://localhost:10000/default> alter table test_ext2 set tblproperties ('EXTERNAL'='true'); > No rows affected (0.149 seconds) > 0: jdbc:hive2://localhost:10000/default> insert into table test_ext2 values ("test"); > WARNING: Hive-on-MR is deprecated in Hive 2 and may not be available in the future versions. Consider using a different execution engine (i.e. spark, tez) or using Hive 1.X releases. > No rows affected (3.447 seconds) > 0: jdbc:hive2://localhost:10000/default> > 0: jdbc:hive2://localhost:10000/default> > 0: jdbc:hive2://localhost:10000/default> select * from test_ext2; > +-----------------+ > | test_ext2.col1 | > +-----------------+ > | test | > +-----------------+ > 1 row selected (0.147 seconds) > 0: jdbc:hive2://localhost:10000/default> truncate table test_ext2; > No rows affected (0.138 seconds) > 0: jdbc:hive2://localhost:10000/default> select * from test_ext2; > +-----------------+ > | test_ext2.col1 | > +-----------------+ > +-----------------+ > No rows selected (0.134 seconds) > 0: jdbc:hive2://localhost:10000/default> > {noformat} -- This message was sent by Atlassian JIRA (v6.3.15#6346)