Workbook Error - java.lang.IllegalStateException: Join Definition Doesn't Match Expected Type

Problem

A Workbook fails immediately when it is started during the compile stage with the following exception:

ERROR [2015-11-03 13:48:24.382] [JobScheduler thread-1] (JobScheduler.java:809) - Job 11951 failed with exception.
java.lang.IllegalStateException: Joined: Join definition does not match expected type. Is RecordType{[INTEGER, STRING, BOOLEAN, INTEGER, STRING, BOOLEAN]} but expected RecordType{[INTEGER, STRING, BOOLEAN]}.
	at datameer.com.google.common.base.Preconditions.checkState(Preconditions.java:197)
	at datameer.dap.common.job.sheets.join.JoinSheetBuilder.createJoinSheet(JoinSheetBuilder.java:87)
	at datameer.dap.common.job.sheets.join.JoinSheetBuilder.registerJobOperations(JoinSheetBuilder.java:50)
	at datameer.dap.common.job.WorkbookJob.registerJobOperations(WorkbookJob.java:267)
	at datameer.dap.common.job.DatameerJob.createExecutionPlan(DatameerJob.java:93)
	at datameer.dap.common.job.DasJobCallable.call(DasJobCallable.java:112)
	at datameer.dap.common.job.DasJobCallable.call(DasJobCallable.java:67)
	at datameer.dap.conductor.job.JobSchedulerJob$2.call(JobSchedulerJob.java:121)
	at datameer.dap.conductor.job.JobSchedulerJob$2.call(JobSchedulerJob.java:106)
	at datameer.dap.common.security.DatameerSecurityService.runAsUser(DatameerSecurityService.java:96)
	at datameer.dap.conductor.job.JobSchedulerJob.call(JobSchedulerJob.java:106)
	at datameer.dap.conductor.job.JobSchedulerJob.call(JobSchedulerJob.java:40)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

Cause

This bug affects Datameer 5.9.4. Other versions might be affected as well.

This issue only occurs if the columns of the source sheet for the self-join have been re-ordered. 

Solution

To work around this issue, edit the Workbook's configuration and save the affected Join sheet.