Support Questions

Find answers, ask questions, and share your expertise

Error when do an alter table change column on an acid table

avatar
New Contributor

Hello,

We have done this before but now we are trying to make a change on a table column and we are getting the follow error:

Error while compiling statement: FAILED: Execution Error, return code 40013 from org.apache.hadoop.hive.ql.ddl.DDLTask. Unable to alter table. Cannot change stats state for a transactional table pro_con.dmcrp001_th_importe_consolidado_contrato without providing the transactional write state for verification (new write ID 327, valid write IDs null; current state null; new state {}

The statement that we are executing is:

alter table `pro_con`.`dmcrp001_th_importe_consolidado_contrato` change column `fecha_movimiento` `fecha_proceso_dia` timestamp comment 'Fecha de referencia de los datos.';

 

2 ACCEPTED SOLUTIONS

avatar
Rising Star

Hi @Edu7478 
Help us in sharing the below details
Exact CDP and CM version .
During the time of issue appears provide us the HS2 and HMS logs from all nodes 
Is table is partitioned table? Share us the DDL for the same
DESCRIBE FORMATTED pro_con.dmcrp001_th_importe_consolidado_contrato;
SHOW CREATE TABLE pro_con.dmcrp001_th_importe_consolidado_contrato;
Try with following  setting at session level   set hive.stats.autogather=false; and rerun the query .If it fails let us know
For more info refer the below KB article
https://community.cloudera.com/t5/Customer/Alter-Table-Fails-With-quot-Unable-to-alter-table-Cannot/...

Thank You.

View solution in original post

avatar
Super Collaborator

Error looks similar to HIVE-27778. 

Can you try the workaround given in the kb

View solution in original post

3 REPLIES 3

avatar
Community Manager

@Shmoo @cravani @mszurap Hi! Do you have any insights here? Thanks!


Regards,

Diana Torres,
Community Moderator


Was your question answered? Make sure to mark the answer as the accepted solution.
If you find a reply useful, say thanks by clicking on the thumbs up button.
Learn more about the Cloudera Community:

avatar
Rising Star

Hi @Edu7478 
Help us in sharing the below details
Exact CDP and CM version .
During the time of issue appears provide us the HS2 and HMS logs from all nodes 
Is table is partitioned table? Share us the DDL for the same
DESCRIBE FORMATTED pro_con.dmcrp001_th_importe_consolidado_contrato;
SHOW CREATE TABLE pro_con.dmcrp001_th_importe_consolidado_contrato;
Try with following  setting at session level   set hive.stats.autogather=false; and rerun the query .If it fails let us know
For more info refer the below KB article
https://community.cloudera.com/t5/Customer/Alter-Table-Fails-With-quot-Unable-to-alter-table-Cannot/...

Thank You.

avatar
Super Collaborator

Error looks similar to HIVE-27778. 

Can you try the workaround given in the kb