共 5 篇文章 |
|
There are two primary ways of modifying data in Hive:Loading files into tables.Hive extension (multiple inserts):FROM from_statementINSERT OVERWRITE TABLE tablename1 [PARTITION (partcol1=val1, partcol2=val2 ...)] select_statement1[INSERT OVERWRITE TABLE tablename2 [PARTITION ...] select_statement2] [INSERT INTO TABLE ... 阅422 转1 评0 公众公开 12-01-11 11:37 |
ALTER TABLE table_name ADD [IF NOT EXISTS] PARTITION partition_spec [LOCATION ''location1''] partition_spec [LOCATION ''location2''] ...partition_spec: : (partition_col = partition_col_value, partition_col = partiton_col_value, ...)ALTER TABLE table_name SET TBLPROPERTIES table_properti... 阅4155 转4 评0 公众公开 12-01-11 11:32 |
INSERT OVERWRITE TABLE pv_gender_sum SELECT pv_users.gender, count (DISTINCT pv_users.userid) FROM pv_users GROUP BY pv_users.gender;FROM pv_users INSERT OVERWRITE TABLE pv_gender_sum SELECT pv_users.gender, count_distinct(pv_users.userid) GROUP BY pv_users.gender INSERT OVERWRITE DIRECTORY ''/user/data/tmp/pv... 阅1190 转2 评0 公众公开 12-01-11 11:22 |
concat_ws(string SEP, string A, string B...)regexp_replace(string INITIAL_STRING, string PATTERN, string REPLACEMENT)get_json_object(string json_string, string path)Extract json object from a json string based on json path specified, and return json string of the extracted json object.xpath, xpath_short, xpath_int, xp... 阅2171 转1 评0 公众公开 12-01-11 11:03 |