Changes between Version 8 and Version 9 of waue/2009/0506
- Timestamp:
- May 6, 2009, 5:08:44 PM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
waue/2009/0506
v8 v9 36 36 }}} 37 37 38 39 38 40 {{{ 39 41 hive> CREATE TABLE invites (foo INT, bar STRING) PARTITIONED BY (ds STRING); 40 42 }}} 41 *輸出如:43 輸出如: 42 44 {{{ 43 45 #!sh … … 46 48 }}} 47 49 50 51 48 52 {{{ 49 53 hive> SHOW TABLES; 50 54 }}} 51 *輸出如:55 輸出如: 52 56 {{{ 53 57 #!sh … … 57 61 }}} 58 62 63 64 59 65 {{{ 60 66 hive> DESCRIBE invites; 61 67 }}} 62 *輸出如:68 輸出如: 63 69 {{{ 64 70 #!sh … … 70 76 }}} 71 77 78 79 72 80 {{{ 73 81 hive> ALTER TABLE pokes ADD COLUMNS (new_col INT); 74 82 }}} 75 *輸出如:83 輸出如: 76 84 {{{ 77 85 #!sh … … 80 88 }}} 81 89 90 91 82 92 {{{ 83 93 hive> ALTER TABLE invites ADD COLUMNS (new_col2 INT COMMENT 'a comment'); 84 94 }}} 85 *輸出如:95 輸出如: 86 96 {{{ 87 97 #!sh … … 89 99 Time taken: 0.152 seconds 90 100 }}} 101 102 91 103 92 104 {{{ … … 94 106 OVERWRITE INTO TABLE pokes; 95 107 }}} 96 *輸出如:108 輸出如: 97 109 {{{ 98 110 #!sh … … 103 115 }}} 104 116 117 118 105 119 {{{ 106 120 hive> LOAD DATA LOCAL INPATH './examples/files/kv2.txt' 107 121 OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-15'); 108 122 }}} 109 *輸出如:123 輸出如: 110 124 {{{ 111 125 #!sh … … 116 130 }}} 117 131 132 133 118 134 {{{ 119 135 hive> LOAD DATA LOCAL INPATH './examples/files/kv3.txt' 120 136 OVERWRITE INTO TABLE invites PARTITION (ds='2008-08-08'); 121 137 }}} 122 *輸出如:138 輸出如: 123 139 {{{ 124 140 #!sh … … 129 145 }}} 130 146 147 148 131 149 {{{ 132 150 hive> INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out' 133 151 SELECT a.* FROM invites a; 134 152 }}} 135 *輸出如:153 輸出如: 136 154 {{{ 137 155 #!sh … … 148 166 }}} 149 167 168 169 150 170 {{{ 151 171 hive> select count(1) from pokes; 152 172 }}} 153 *輸出如:173 輸出如: 154 174 {{{ 155 175 #!sh … … 178 198 }}} 179 199 200 201 180 202 {{{ 181 203 hive> INSERT OVERWRITE DIRECTORY '/tmp/hdfs_out' SELECT a.* FROM invites a; 182 204 }}} 183 *輸出如:205 輸出如: 184 206 {{{ 185 207 #!sh … … 196 218 }}} 197 219 220 221 198 222 {{{ 199 223 hive> INSERT OVERWRITE DIRECTORY '/tmp/reg_5' SELECT COUNT(1) FROM invites a; 200 224 }}} 201 *輸出如:225 輸出如: 202 226 {{{ 203 227 #!sh