Return-Path: Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: (qmail 71961 invoked from network); 24 Dec 2009 05:16:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 24 Dec 2009 05:16:45 -0000 Received: (qmail 55323 invoked by uid 500); 24 Dec 2009 05:16:44 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 55221 invoked by uid 500); 24 Dec 2009 05:16:44 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 55212 invoked by uid 500); 24 Dec 2009 05:16:44 -0000 Delivered-To: apmail-hadoop-core-commits@hadoop.apache.org Received: (qmail 55209 invoked by uid 99); 24 Dec 2009 05:16:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2009 05:16:44 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 24 Dec 2009 05:16:42 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id B152A16E07; Thu, 24 Dec 2009 05:16:20 +0000 (GMT) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable From: Apache Wiki To: Apache Wiki Date: Thu, 24 Dec 2009 05:16:20 -0000 Message-ID: <20091224051620.27889.72603@eos.apache.org> Subject: =?utf-8?q?=5BHadoop_Wiki=5D_Update_of_=22Hive/Tutorial=22_by_Ning_Zhang?= X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for ch= ange notification. The "Hive/Tutorial" page has been changed by Ning Zhang. The comment on this change is: =E2=88=9A. http://wiki.apache.org/hadoop/Hive/Tutorial?action=3Ddiff&rev1=3D18&rev2=3D= 19 -------------------------------------------------- . |=E2=86=92INT . |=E2=86=92TINYINT |=E2=86=92FLOAT + . |=E2=86=92INT + . |=E2=86=92TINYINT |=E2=86=92STRING . |=E2=86=92BOOLEAN |=E2=86=92Complex Type = - This type hierarchy defines how the types are implicitly converted in the= query language. Implicit conversion is allowed for types from child to an = ancestor. So when a query expression expects type1 and the data is of type2= type2 is implicitly converted to type1 if type1 is an ancestor of type2 in= the type hierarchy. Apart from these fundamental rules for implicit conver= sion based on type system, Hive also allows the special case for conversion: + This type hierarchy defines how the types are implicitly converted in the= query language. Implicit conversion is allowed for types from child to an = ancestor. So when a query expression expects type1 and the data is of type2= type2 is implicitly converted to type1 if type1 is an ancestor of type2 in= the type hierarchy. Apart from these fundamental rules for implicit conver= sion based on type system, Hive also allows the special implicit type conve= rsion for convenience: = * STRING =E2=86=92 DOUBLE = @@ -104, +106 @@ * Arithmetic Operators - The following operators support various common = arithmetic operations on the operands. All of them return number types. = ''' Arithmetic Operators ''' - ||Operator ||Operand types ||Description || + ||'''Operator''' ||'''Operand types''' ||'''Description''' || - ||A + B ||all number types ||Gives the result of adding A and B. The type= of the result is the same as the common parent(in the type hierarchy) of t= he types of the operands. e.g. since every integer is a float, therefore fl= oat is a containing type of integer so the + operator on a float and an int= will result in a float. || + ||A + B ||all number types ||Gives the result of adding A and B. The type= of the result is the same as the common parent(in the type hierarchy) of t= he types of the operands. For example, since every integer is a float, FLOA= T is a containing type of INT. So the + operator on a float and an int wil= l result in a float. || ||A - B ||all number types ||Gives the result of subtracting B from A. Th= e type of the result is the same as the common parent(in the type hierarchy= ) of the types of the operands. || ||A * B ||all number types ||Gives the result of multiplying A and B. The= type of the result is the same as the common parent(in the type hierarchy)= of the types of the operands. Note that if the multiplication causing over= flow, you will have to cast one of the operators to a type higher in the ty= pe hierarchy. || ||A / B ||all number types ||Gives the result of dividing B from A. The t= ype of the result is the same as the common parent(in the type hierarchy) o= f the types of the operands. If the operands are integer types, then the re= sult is the quotient of the division. || @@ -125, +127 @@ ||A AND B ||boolean ||TRUE if both A and B are TRUE, otherwise FALSE || ||A && B ||boolean ||Same as A AND B || ||A OR B ||boolean ||TRUE if either A or B or both are TRUE, otherwise FA= LSE || - ||{{{ A || B }}} ||boolean ||Same as A OR B || + ||A || B ||boolean ||Same as A OR B || ||NOT A ||boolean ||TRUE if A is FALSE, otherwise FALSE || ||!A ||boolean ||Same as NOT A || =20