Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 515B117437 for ; Mon, 27 Apr 2015 18:34:22 +0000 (UTC) Received: (qmail 52982 invoked by uid 500); 27 Apr 2015 18:34:21 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 52911 invoked by uid 500); 27 Apr 2015 18:34:21 -0000 Mailing-List: contact dev-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 dev@hive.apache.org Received: (qmail 52890 invoked by uid 99); 27 Apr 2015 18:34:21 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 27 Apr 2015 18:34:21 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 510981DB6CF; Mon, 27 Apr 2015 18:34:22 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============8611575342274950975==" MIME-Version: 1.0 Subject: Re: Review Request 33171: HIVE-10307:Support to use number literals in partition column From: "Chaoyu Tang" To: "Szehon Ho" , "Xuefu Zhang" , "Ashutosh Chauhan" Cc: "Jimmy Xiang" , "hive" , "Chaoyu Tang" , "Lefty Leverenz" Date: Mon, 27 Apr 2015 18:34:22 -0000 Message-ID: <20150427183422.17829.18955@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: "Chaoyu Tang" X-ReviewGroup: hive X-ReviewRequest-URL: https://reviews.apache.org/r/33171/ X-Sender: "Chaoyu Tang" References: <20150427165816.17829.18006@reviews.apache.org> In-Reply-To: <20150427165816.17829.18006@reviews.apache.org> Reply-To: "Chaoyu Tang" X-ReviewRequest-Repository: hive-git --===============8611575342274950975== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/33171/ ----------------------------------------------------------- (Updated April 27, 2015, 6:34 p.m.) Review request for hive, Ashutosh Chauhan, Szehon Ho, and Xuefu Zhang. Changes ------- Updated archive_partspec1.q.out to reflect the test output change after rebasing to today's code. Bugs: HIVE-10307 https://issues.apache.org/jira/browse/HIVE-10307 Repository: hive-git Description ------- Data types like TinyInt, SmallInt, BigInt or Decimal can be expressed as literals with postfix like Y, S, L, or BD appended to the number. These literals work in most Hive queries, but do not when they are used as partition column value. This patch is to address the issue of number literals used in partition specification. Highlights of the changes: 1. Validate, convert and normalize the partVal in partSpec to match its column type when hive.partition.check.column.type is set to true (default). It not only applies to opertion insert which used to be controlled by "hive.typecheck.on.insert", but also for other partition operations (e.g. alter table .. partition, partition statistics etc). The hive.typecheck.on.insert is now removed. 2. Convert and normalize legacy partition column data by using alter table partition .. rename with hive.partition.check.old.column.type.in.rename set to true. this property only allows the partVal in old PartSpec to skip the type check, conversion in partition rename. Diffs (updated) ----- common/src/java/org/apache/hadoop/hive/conf/HiveConf.java c9ee423 ql/src/java/org/apache/hadoop/hive/ql/parse/BaseSemanticAnalyzer.java f49ad0c ql/src/java/org/apache/hadoop/hive/ql/parse/ColumnStatsSemanticAnalyzer.java e8066be ql/src/java/org/apache/hadoop/hive/ql/parse/DDLSemanticAnalyzer.java 76a0eee ql/src/test/queries/clientpositive/alter_partition_coltype.q 8c9945c ql/src/test/results/clientnegative/archive_partspec1.q.out da4817c ql/src/test/results/clientnegative/archive_partspec5.q.out c18de52 ql/src/test/results/clientpositive/partition_timestamp.q.out bc6ab10 ql/src/test/results/clientpositive/partition_timestamp2.q.out 365df69 Diff: https://reviews.apache.org/r/33171/diff/ Testing ------- 1. Manaully tests covering various number literals (Y, S, L, BD) 2. new qfile test (partition_coltype_literals.q) 3. Precommit build Thanks, Chaoyu Tang --===============8611575342274950975==--