[Hive] New field for hive partition table

Source: Internet
Author: User

Has not been tried, the concept of being partitioned was frightened, and today tried under, very simple

Hive (default) > Desc pms.test_cross_sale_path;okcol_name    data_type   commentpath_id string  visit_ track_id  string  visit_product_id    bigint  visit_category_id   bigint  visit_brand_id  bigint  rcmd_track_id   string  rcmd_product_id bigint  rcmd_category_id    bigint  rcmd_ brand_id   bigint  rcmd_algorithm_id   bigint  cart_track_id   string  cart_track_time String  cart_product_id bigint  cart_category_id    bigint  cart_brand_id   bigint  path_ Type   int path_length int path_list   string  session_id  string  gu_id   string  end_ user_id string  ds  string time  taken:3.159 seconds
Two new fields in the table platform_id, TPA, type int

Hive (PMS) > ALTER TABLE Pms.test_cross_sale_path add columns (platform_id int, TPA int); Failed:parseexception line 1:12 cannot recognize input near ' PMS '. ' ' Test_cross_sale_path ' in ALTER TABLE statement
This will be problematic, the database name is not supported by default, in a different way

Hive (PMS) > Use PMS;                                                                   Oktime taken:0.012 secondshive (PMS) > ALTER TABLE Test_cross_sale_path add columns (platform_id int, tPA int); Oktime ta ken:0.012 seconds
The new field is added to the end of the table, before the partition field, and both fields are NULL in the previous partition

Hive (default) > Desc pms.test_cross_sale_path;okcol_namedata_typecommentpath_idstringvisit_track_idstringvisit _product_idbigintvisit_category_idbigintvisit_brand_idbigintrcmd_track_idstringrcmd_product_idbigintrcmd_ Category_idbigintrcmd_brand_idbigintrcmd_algorithm_idbigintcart_track_idstringcart_track_timestringcart_ Product_idbigintcart_category_idbigintcart_brand_idbigintpath_typeintpath_lengthintpath_liststringsession_ Idstringgu_idstringend_user_idstringplatform_idinttpaintdsstringtime taken:3.159 seconds

[Hive] New field for hive partition table

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.