Symptom
Attempting to create a Join fails with the following exception:
RegularRequirementNotMetFailure[All sheets of 'JoinPair{Sheet![Column]<=>Sheet![Column]}' do exist in previous pairs]
at datameer.persistence.Result.requirementNotMet(Result.java:257)
at datameer.persistence.EntityTask.requirementNotMet(EntityTask.java:457)
at datameer.dap.conductor.workbook.command.impl.ModifyJoinSheetImpl.lambda$null$2(ModifyJoinSheetImpl.java:65)
at datameer.com.google.common.base.Present.transform(Present.java:75)
at datameer.dap.conductor.workbook.command.impl.ModifyJoinSheetImpl.lambda$updateJoinSheet$3(ModifyJoinSheetImpl.java:65)
at datameer.persistence.Result$Success.map(Result.java:926)
Cause
When joining two Sheets on one or more keys, a TWO_MEMBER_JOIN
should be used. Here is an example of Joining two Sheets: Sheet1
and Sheet2
by 4 key pairs (joinColumns).
name: "Joined",
sheetId: "20562099-7bd6-44ce-80e9-8b83f2bf7b2e",
sheetType: "das.internal.JoinedSheetType",
keep: true,
sheetDefinition: {
joinCategory: "TWO_MEMBER_JOIN",
joinPairs: [
{
joinType: "INNER",
sheet1: "Sheet1",
sheet2: "Sheet2",
joinColumns1: [
"ID",
"Col1",
"Col2",
"Col3"
],
joinColumns2: [
"ID",
"Col1",
"Col2",
"Col3"
] } ],
To join more than two Sheets, a MULTI_JOIN
should be created. Here is an example of Joining Sheet Sheet1
with Sheets Sheet2
and Sheet3
.
name: "Joined",
sheetId: "20562099-7bd6-44ce-80e9-8b83f2bf7b2e",
sheetType: "das.internal.JoinedSheetType",
keep: true,
sheetDefinition: {
joinCategory: "MULTI_JOIN",
joinPairs: [
{
joinType: "INNER",
sheet1: "Sheet1",
sheet2: "Sheet2",
joinColumns1: [
"ID"
],
joinColumns2: [
"ID"
]
},
{
joinType: "INNER",
sheet1: "Sheet1",
sheet2: "Sheet3",
joinColumns1: [
"ID"
],
joinColumns2: [
"ID"
] } ],
Attempting to use a MULTI_JOIN
to join Sheet1
and Sheet2
by the ID
column and then again join the same Sheets by the column Col1
will lead to the RegularRequirementNotMetFailure
exception.
RegularRequirementNotMetFailure[All sheets of 'JoinPair{Sheet1![Col1]<=>Sheet2![Col1]}' do exist in previous pairs]
at datameer.persistence.Result.requirementNotMet(Result.java:257)
at datameer.persistence.EntityTask.requirementNotMet(EntityTask.java:457)
at datameer.dap.conductor.workbook.command.impl.ModifyJoinSheetImpl.lambda$null$2(ModifyJoinSheetImpl.java:65)
at datameer.com.google.common.base.Present.transform(Present.java:75)
at datameer.dap.conductor.workbook.command.impl.ModifyJoinSheetImpl.lambda$updateJoinSheet$3(ModifyJoinSheetImpl.java:65)
at datameer.persistence.Result$Success.map(Result.java:926)
at datameer.persistence.EntityTask$20.run(EntityTask.java:754)
at datameer.persistence.EntityTask$20$1.apply(EntityTask.java:758)
at datameer.persistence.EntityTask$20$1.apply(EntityTask.java:755)
Solution
Rather than using a MULTI_JOIN
, use the appropriate TWO_MEMBER_JOIN
.
Comments
0 comments
Please sign in to leave a comment.