title: Hive Alter External Table and Update Schema
body: <p>I am looking for a command to add columns and update schema for my Hive External table backed by Avro schema. </p>
  
  <p>Here is what I have tried so far. </p>
  
  <p>I have a Hive External Table with Avro backed Schema created with this command - </p>
  
  <pre><code>CREATE EXTERNAL TABLE `person_hourly`(
    'personid' string COMMENT '', 
    'name' string COMMENT '' 
    )
  PARTITIONED BY ( 
    'partitiontime' string)
  ROW FORMAT SERDE 
    'org.apache.hadoop.hive.serde2.avro.AvroSerDe' 
  STORED AS INPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.avro.AvroContainerInputFormat' 
  OUTPUTFORMAT 
    'org.apache.hadoop.hive.ql.io.avro.AvroContainerOutputFormat'
  LOCATION
    'hdfs://nameservice1/web/PersonData/'
  TBLPROPERTIES (
    'avro.schema.url'='hdfs:///schemas/PersonV1.avsc'
    )
  </code></pre>
  
  <p>I would like to add additional columns and update schema for this table. </p>
  
  <p><code>alter table person_hourly ADD COLUMNS (lastname string ) SET TBLPROPERTIES ('avro.schema.url' = 'hdfs:///schemas/PersonV2.avsc')</code></p>
  
  <p>But I cannot do this since I get an error 
  <code>FAILED: ParseException line 1:64 missing EOF at 'SET' near ')'</code></p>
  
  <p>So I tried adding column separately, which worked, but I cannot update the schema 
  <code>FAILED: Execution Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. at least one column must be specified for the table</code> </p>