Attempting to run
upgrade_db.sh to update the
dap database while upgrading from 6.4.x to 7.1.x returns the following error:
Processing upgrade 6.4.2-DAP_34276 /opt/datameer/Datameer-7.1.2-hdp-2.5.5/bin/upgrades/optional/upgrade-6.4.2-DAP_34276.sql writing transformed script to /opt/datameer/Datameer-7.1.2-hdp-2.5.5/upgrade_transformed/20180329115037/upgrade-6.4.2-DAP_34276.sql ERROR 1060 (42S21) at line 1: Duplicate column name 'execution_data_directory' Abort, /opt/datameer/Datameer-7.1.2-hdp-2.5.5/upgrade_transformed/20180329115037/upgrade-6.4.2-DAP_34276.sql fails!
A previous database rollback didn't drop the
dap database prior to restoring the backup. A restore doesn't remove new columns, just overwrites any existing columns with the old data. As a result the
execution_data_directory column already existed.
The contents of upgrade-6.4.2-DAP_34276.sql are as follows:
ALTER TABLE dap_job_configuration ADD COLUMN execution_data_directory varchar(5000) NOT NULL AFTER data_volume_size_by_license_period; UPDATE dap_job_configuration SET execution_data_directory = id;
This creates the column
execution_data_directory after the column
data_volume_size_by_license_period and then sets the value of this column as the same as the value of the
Because the data for
execution_data_directory is new and hasn't deviated from the
id column yet, you can safely drop this column in the existing database then run the upgrade script to avoid the issue.
- Backup your Datameer dap database.
- Log into the MySQL CLI interface.
ALTER TABLE dap_job_configuration DROP COLUMN execution_data_directory;