Return-Path: X-Original-To: apmail-hive-commits-archive@www.apache.org Delivered-To: apmail-hive-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C122017E6B for ; Thu, 9 Apr 2015 19:15:09 +0000 (UTC) Received: (qmail 19531 invoked by uid 500); 9 Apr 2015 19:14:47 -0000 Delivered-To: apmail-hive-commits-archive@hive.apache.org Received: (qmail 19488 invoked by uid 500); 9 Apr 2015 19:14:47 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 19477 invoked by uid 99); 9 Apr 2015 19:14:47 -0000 Received: from eris.apache.org (HELO hades.apache.org) (140.211.11.105) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 09 Apr 2015 19:14:47 +0000 Received: from hades.apache.org (localhost [127.0.0.1]) by hades.apache.org (ASF Mail Server at hades.apache.org) with ESMTP id 56525AC019D for ; Thu, 9 Apr 2015 19:14:47 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1672464 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/exec/DDLTask.java test/results/clientnegative/alter_table_wrong_regex.q.out Date: Thu, 09 Apr 2015 19:14:47 -0000 To: commits@hive.apache.org From: szehon@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20150409191447.56525AC019D@hades.apache.org> Author: szehon Date: Thu Apr 9 19:14:46 2015 New Revision: 1672464 URL: http://svn.apache.org/r1672464 Log: HIVE-10206 : Improve Alter Table to not initialize Serde unnecessarily (Szehon, reviewed by Chao and Jimmy Xiang) Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java hive/trunk/ql/src/test/results/clientnegative/alter_table_wrong_regex.q.out Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=1672464&r1=1672463&r2=1672464&view=diff ============================================================================== --- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original) +++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Thu Apr 9 19:14:46 2015 @@ -3404,13 +3404,13 @@ public class DDLTask extends Task oldCols = (part == null ? tbl.getCols() : part.getCols()); - StorageDescriptor sd = (part == null ? tbl.getTTable().getSd() : part.getTPartition().getSd()); if (alterTbl.getOp() == AlterTableDesc.AlterTableTypes.RENAME) { tbl.setDbName(Utilities.getDatabaseName(alterTbl.getNewName())); tbl.setTableName(Utilities.getTableName(alterTbl.getNewName())); } else if (alterTbl.getOp() == AlterTableDesc.AlterTableTypes.ADDCOLS) { + List oldCols = (part == null ? tbl.getCols() : part.getCols()); + StorageDescriptor sd = (part == null ? tbl.getTTable().getSd() : part.getTPartition().getSd()); List newCols = alterTbl.getNewCols(); String serializationLib = sd.getSerdeInfo().getSerializationLib(); if (serializationLib.equals( @@ -3437,6 +3437,8 @@ public class DDLTask extends Task oldCols = (part == null ? tbl.getCols() : part.getCols()); + StorageDescriptor sd = (part == null ? tbl.getTTable().getSd() : part.getTPartition().getSd()); List newCols = new ArrayList(); Iterator iterOldCols = oldCols.iterator(); String oldName = alterTbl.getOldColName(); @@ -3499,6 +3501,7 @@ public class DDLTask extends Task 0)) { @@ -3539,6 +3544,7 @@ public class DDLTask extends Task columns = Utilities.getColumnNamesFromFieldSchema(tbl .getCols()); @@ -3583,6 +3590,7 @@ public class DDLTask extends Task