hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Hadoop Wiki] Trivial Update of "Hive/HiveQL/Types" by ZhengShao
Date Wed, 21 Jan 2009 22:50:02 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change notification.

The following page has been changed by ZhengShao:
http://wiki.apache.org/hadoop/Hive/HiveQL/Types

------------------------------------------------------------------------------
  == Types supported By Hive ==
  The following types are supported by Hive:
-  * !TinyInt
-  * !SmallInt
-  * Int
-  * !BigInt
-  * Double
-  * Boolean
-  * String
+  * !TinyInt: 1-byte signed integer from -2^7 (-128) to 2^7-1 (127).
+  * !SmallInt: 2-byte signed integer from -2^15 (-32768) to 2^15-1 (32767).
+  * Int: 4-byte signed integer from -2^31 to 2^31-1.
+  * !BigInt: 8-byte signed integer from -2^63 to 2^63-1.
+  * Double: 8-byte double-precision float.
+  * Boolean: 1-bit true or false flag.
+  * String: Arbitrary-length unicode string (will be encoded in utf-8 in serialization/deserialization)
+ 
+ All types can take a special value called NULL, as per SQL standard.
  
  Float is not supported because it's not supported by Thrift, and Hive uses Thrift a lot
for internal data serialization/deserialization.
  
  Examples of creating a table with columns of various types:
  
+ {{{
- (((
- 
  CREATE TABLE test_table (
  a TINYINT,
  b SMALLINT,
@@ -25, +26 @@

  f BOOLEAN,
  g STRING,
  );
+ }}}
- 
- )))
  
  == Implicit and Explicit Type Conversions ==
- In most cases, users don't need to care about the types, 
+ In most cases, users don't need to care about the types because Hive is able to do implicit
type conversions.
+ However there are some cases that user wants to convert the values by himself.
  
+ 
+ In particular, these are several special cases.
+ 

Mime
View raw message