Swaranga Sarma created HIVE-17531:
-------------------------------------

             Summary: Alter Table does not work
                 Key: HIVE-17531
                 URL: https://issues.apache.org/jira/browse/HIVE-17531
             Project: Hive
          Issue Type: Bug
          Components: Metastore
    Affects Versions: 2.1.1
         Environment: AWS EMR
            Reporter: Swaranga Sarma


I have a table defined as:
                            
marketplaceid           string                                      
requestid               string                                      
purchaseid              string                                      
customerid              string                                      
sessionid               string                                      
datestamp               bigint                                      
deliverygroups          
array<struct<lineitems:array<struct<ourpriceamount:double,ourpricecurrencycode:string,quantity:int,upsellpromisequality:string,asin:string,merchant_id:bigint,validitemshipoptions:array<string>,upsellpromisedeliverydate:string>>,selectedssp:string,shipoptions:array<struct<isdefault:boolean,price:string,shipoptionname:string,upsellpromisequality:string,fasttrackpromisedeliverydate:bigint>>,deliveryprogram:string,validssp:string,deliverygroupid:string,preferredssp:string,addressid:string,selecteddeliveryoption:string>>
                           
year                    string                                      
month                   string                                      
day                     string                                      
hour                    string                                      

I am trying to add a new field to the deliveryGroups[*].shipOptions structure 
called qualifyingNoRushPromotionId of type string. I am using the below command 
to apply the change:

ALTER TABLE my_table CHANGE COLUMN deliverygroups deliverygroups 
array<struct<lineitems:array<struct<ourpriceamount:double,ourpricecurrencycode:string,quantity:int,upsellpromisequality:string,asin:string,merchant_id:bigint,validitemshipoptions:array<string>,upsellpromisedeliverydate:string>>,selectedssp:string,shipoptions:array<struct<isdefault:boolean,price:string,shipoptionname:string,upsellpromisequality:string,fasttrackpromisedeliverydate:bigint,qualifyingNoRushPromotionId:string>>,deliveryprogram:string,validssp:string,deliverygroupid:string,preferredssp:string,addressid:string,selecteddeliveryoption:string>>;

However I get the following error when I run this commend:

FAILED: Execution Error, return code 1 from 
org.apache.hadoop.hive.ql.exec.DDLTask. Unable to alter table. The following 
columns have types incompatible with the existing columns in their respective 
positions :
deliverygroups

What could be the issue. Please assist.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to