欢迎投稿

今日深度:

Hive的数据类型,

Hive的数据类型,


1.基本数据类型
          hive类型         说明              java类型    实例
        1).tinyint    1byte有符号的整数        byte       20
        2).smalint    2byte有符号的整数        short      20
        3).int        4byte有符号的整数        int        20
        4).bigint     8byte有符号的整数        long       20
        5).boolean    布尔类型,true或false    boolean    true
        6).float      单精度                   float      3.217
        7).double     双精度                   double     3.212
        8).string     字符序列,单双即可       string     ‘zhang’;“ashakjds” 
        9).timestamp  时间戳,精确的纳秒       timestamp  ‘158030219111’
      10).binary     字节数组                 byte[]     
2.集合数据类型
         hive类型         说明                                 java类型       实例
       1).struct      对象类型,可以通过字段名.元素名来访问     object   struct('name','age')
       2).map         一组键值对的元组                          map      map('name','zhangsan','age','23')
       3).array       数组                                      array    array('name','age')
       4).union       组合                                      
3.案例:
       hive>create table employees(
           >  name string,
       >  salary float,
       >  subordinates array<string>,
       >  deductions map<string,float>,
       >  address struct<street:string,city:string,state:string,zip:int>
       > );
 

www.htsjk.Com true http://www.htsjk.com/hive/36116.html NewsArticle Hive的数据类型, 1.基本数据类型           hive类型         说明              java类型    实例         1).tinyint    1byte有符号的整数        byte       20         2).smalint    ...
相关文章
    暂无相关文章
评论暂时关闭