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 66C3E200CFD for ; Wed, 6 Sep 2017 20:42:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 655391609C0; Wed, 6 Sep 2017 18:42:06 +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 B39171609B8 for ; Wed, 6 Sep 2017 20:42:05 +0200 (CEST) Received: (qmail 57094 invoked by uid 500); 6 Sep 2017 18:42:04 -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 57075 invoked by uid 99); 6 Sep 2017 18:42:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Sep 2017 18:42:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id CC5E8CCEC2 for ; Wed, 6 Sep 2017 18:42:03 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id NNtL7JGgnU1h for ; Wed, 6 Sep 2017 18:42:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6C62861276 for ; Wed, 6 Sep 2017 18:42:02 +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 64840E0EFD for ; Wed, 6 Sep 2017 18:42:01 +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 A7B3824172 for ; Wed, 6 Sep 2017 18:42:00 +0000 (UTC) Date: Wed, 6 Sep 2017 18:42:00 +0000 (UTC) From: "Chaozhong Yang (JIRA)" To: issues@hive.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-17460) `insert overwrite` should support table schema evolution (e.g. add columns) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 06 Sep 2017 18:42:06 -0000 [ https://issues.apache.org/jira/browse/HIVE-17460?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16155867#comment-16155867 ] Chaozhong Yang commented on HIVE-17460: --------------------------------------- [~wei.zheng] Yes, I have move those code into alterPartitionSpecInMemory. > `insert overwrite` should support table schema evolution (e.g. add columns) > --------------------------------------------------------------------------- > > Key: HIVE-17460 > URL: https://issues.apache.org/jira/browse/HIVE-17460 > Project: Hive > Issue Type: Bug > Affects Versions: 2.1.0, 2.2.0 > Reporter: Chaozhong Yang > Assignee: Chaozhong Yang > Fix For: 3.0.0 > > Attachments: HIVE-17460.2.patch, HIVE-17460.patch > > > In Hive, adding columns into original table is a common use case. However, if we insert overwrite older partitions after adding columns, added columns will not be accessed. > ``` > create table src_table( > i int > ) > PARTITIONED BY (`date` string); > insert overwrite table src_table partition(`date`='20170905') valu > es (3); > select * from src_table where `date` = '20170905'; > alter table src_table add columns (bi bigint); > insert overwrite table src_table partition(`date`='20170905') valu > es (3, 5); > select * from src_table where `date` = '20170905'; > ``` > The result will be as follows: > ``` > 3, NULL, '20170905' > ``` > Obviously, it doesn't meet our expectation. The expected result should be: > ``` > 3, 5, '20170905' > ``` -- This message was sent by Atlassian JIRA (v6.4.14#64029)