Changes between Version 8 and Version 9 of waue/2009/0506


Ignore:
Timestamp:
May 6, 2009, 5:08:44 PM (15 years ago)
Author:
waue
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • waue/2009/0506

    v8 v9  
    3636}}}
    3737
     38
     39
    3840{{{
    3941hive> CREATE TABLE invites (foo INT, bar STRING) PARTITIONED BY (ds STRING);
    4042}}}
    41  * 輸出如:
     43   輸出如:
    4244{{{
    4345#!sh
     
    4648}}}
    4749
     50
     51
    4852{{{
    4953hive> SHOW TABLES;
    5054}}}
    51  * 輸出如:
     55   輸出如:
    5256{{{
    5357#!sh
     
    5761}}}
    5862
     63
     64
    5965{{{
    6066hive> DESCRIBE invites;
    6167}}}
    62  * 輸出如:
     68   輸出如:
    6369{{{
    6470#!sh
     
    7076}}}
    7177
     78
     79
    7280{{{
    7381hive> ALTER TABLE pokes ADD COLUMNS (new_col INT);
    7482}}}
    75  * 輸出如:
     83   輸出如:
    7684{{{
    7785#!sh
     
    8088}}}
    8189
     90
     91
    8292{{{
    8393hive> ALTER TABLE invites ADD COLUMNS (new_col2 INT COMMENT 'a comment');
    8494}}}
    85  * 輸出如:
     95   輸出如:
    8696{{{
    8797#!sh
     
    8999Time taken: 0.152 seconds
    90100}}}
     101
     102
    91103
    92104{{{
     
    94106OVERWRITE INTO TABLE pokes;
    95107}}}
    96  * 輸出如:
     108   輸出如:
    97109{{{
    98110#!sh
     
    103115}}}
    104116
     117
     118
    105119{{{
    106120hive> LOAD DATA LOCAL INPATH './examples/files/kv2.txt'
    107121OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-15');
    108122}}}
    109  * 輸出如:
     123   輸出如:
    110124{{{
    111125#!sh
     
    116130}}}
    117131
     132
     133
    118134{{{
    119135hive> LOAD DATA LOCAL INPATH './examples/files/kv3.txt'
    120136OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-08');
    121137}}}
    122  * 輸出如:
     138   輸出如:
    123139{{{
    124140#!sh
     
    129145}}}
    130146
     147
     148
    131149{{{
    132150hive> INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out'
    133151SELECT a.* FROM invites a;
    134152}}}
    135  * 輸出如:
     153   輸出如:
    136154{{{
    137155#!sh
     
    148166}}}
    149167
     168
     169
    150170{{{
    151171hive> select count(1) from pokes;
    152172}}}
    153  * 輸出如:
     173   輸出如:
    154174{{{
    155175#!sh
     
    178198}}}
    179199
     200
     201
    180202{{{
    181203hive> INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out' SELECT a.* FROM invites a;
    182204}}}
    183  * 輸出如:
     205   輸出如:
    184206{{{
    185207#!sh
     
    196218}}}
    197219
     220
     221
    198222{{{
    199223hive>  INSERT OVERWRITE DIRECTORY '/tmp/reg_5' SELECT COUNT(1) FROM invites a;
    200224}}}
    201  * 輸出如:
     225   輸出如:
    202226{{{
    203227#!sh