Support Questions
Find answers, ask questions, and share your expertise

Persistence error while running a Pig script for the first time on Ambari view

Persistence error while running a Pig script for the first time on Ambari view

New Contributor

I get the following error while running a Pig script for the first time on a new installation of Ambari 2.2.1.1 view for Pig on HDP 2.4.0

org.apache.ambari.view.PersistenceException: Caught exception trying to find org.apache.ambari.view.pig.resources.jobs.models.PigJob where null
....
Caused by: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ambari.DS_PIGJOB_51' doesn't exist
Error Code: 1146
Call: SELECT DS_id, DS_dateStarted, DS_duration, DS_forcedContent, DS_inProgress, DS_jobId, DS_jobType, DS_owner, DS_percentComplete, DS_pigScript, DS_pythonScript, DS_scriptId, DS_sourceFile, DS_sourceFileContent, DS_status, DS_statusDir, DS_templetonArguments, DS_title FROM DS_PIGJOB_51
Query: ReadAllQuery(referenceClass=DS_PigJob_51 sql="SELECT DS_id, DS_dateStarted, DS_duration, DS_forcedContent, DS_inProgress, DS_jobId, DS_jobType, DS_owner, DS_percentComplete, DS_pigScript, DS_pythonScript, DS_scriptId, DS_sourceFile, DS_sourceFileContent, DS_status, DS_statusDir, DS_templetonArguments, DS_title FROM DS_PIGJOB_51")
....

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'ambari.DS_PIGJOB_51' doesn't exist

Checking the MySQL DB for Ambari, I found that it has a table DS_PIGSCRIPT_52, but no DS_PIGJOB_51. Has anybody faced this issue before? Can this be fixed by creating this table?

2 REPLIES 2

Re: Persistence error while running a Pig script for the first time on Ambari view

If you could provide the script (or a boiled-down version of it) then maybe one of us could try to reproduce the error and offer some insight, or at least another observation.

Re: Persistence error while running a Pig script for the first time on Ambari view

New Contributor

I worked separately with Hortonworks support for this and the cause of this issue was a missing table in Ambari database (in my case, MySQL). The solution was to create this table as follows:

CREATE TABLE `DS_PIGJOB_51` (
`DS_id` varchar(255) NOT NULL,
`DS_dateStarted` bigint(20) DEFAULT NULL,
`DS_duration` bigint(20) DEFAULT NULL,
`DS_forcedContent` varchar(3200) DEFAULT NULL,
`DS_inProgress` tinyint(1) DEFAULT '0',
`DS_jobId` varchar(3200) DEFAULT NULL,
`DS_jobType` varchar(3200) DEFAULT NULL,
`DS_owner` varchar(3200) DEFAULT NULL,
`DS_percentComplete` int(11) DEFAULT NULL,
`DS_pigScript` varchar(3200) DEFAULT NULL,
`DS_pythonScript` varchar(3200) DEFAULT NULL,
`DS_scriptId` varchar(3200) DEFAULT NULL,
`DS_sourceFile` varchar(3200) DEFAULT NULL,
`DS_sourceFileContent` varchar(3200) DEFAULT NULL,
`DS_status` varchar(3200) DEFAULT NULL,
`DS_statusDir` varchar(3200) DEFAULT NULL,
`DS_templetonArguments` varchar(3200) DEFAULT NULL,
`DS_title` varchar(3200) DEFAULT NULL,
PRIMARY KEY (`DS_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;