use of org.pentaho.di.trans.steps.mergejoin.MergeJoinMeta in project pentaho-kettle by pentaho.
the class MergeJoinDialog method getKeys1.
private void getKeys1() {
MergeJoinMeta joinMeta = new MergeJoinMeta();
getMeta(joinMeta);
try {
List<StreamInterface> infoStreams = joinMeta.getStepIOMeta().getInfoStreams();
StepMeta stepMeta = infoStreams.get(0).getStepMeta();
if (stepMeta != null) {
RowMetaInterface prev = transMeta.getStepFields(stepMeta);
if (prev != null) {
BaseStepDialog.getFieldsFromPrevious(prev, wKeys1, 1, new int[] { 1 }, new int[] {}, -1, -1, null);
}
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "MergeJoinDialog.ErrorGettingFields.DialogTitle"), BaseMessages.getString(PKG, "MergeJoinDialog.ErrorGettingFields.DialogMessage"), e);
}
}
use of org.pentaho.di.trans.steps.mergejoin.MergeJoinMeta in project pentaho-kettle by pentaho.
the class MergeJoinDialog method getKeys2.
private void getKeys2() {
MergeJoinMeta joinMeta = new MergeJoinMeta();
getMeta(joinMeta);
try {
List<StreamInterface> infoStreams = joinMeta.getStepIOMeta().getInfoStreams();
StepMeta stepMeta = infoStreams.get(1).getStepMeta();
if (stepMeta != null) {
RowMetaInterface prev = transMeta.getStepFields(stepMeta);
if (prev != null) {
BaseStepDialog.getFieldsFromPrevious(prev, wKeys2, 1, new int[] { 1 }, new int[] {}, -1, -1, null);
}
}
} catch (KettleException e) {
new ErrorDialog(shell, BaseMessages.getString(PKG, "MergeJoinDialog.ErrorGettingFields.DialogTitle"), BaseMessages.getString(PKG, "MergeJoinDialog.ErrorGettingFields.DialogMessage"), e);
}
}
use of org.pentaho.di.trans.steps.mergejoin.MergeJoinMeta in project pentaho-metaverse by pentaho.
the class MetaverseValidationIT method testMergeJoinStepNode_duplicateFieldNames.
@Test
public void testMergeJoinStepNode_duplicateFieldNames() throws Exception {
MergeJoinStepNode node = root.getMergeJoinStepNode();
MergeJoinMeta meta = (MergeJoinMeta) getStepMeta(node);
assertEquals(meta.getJoinType(), node.getJoinType());
assertEquals(meta.getKeyFields1().length, node.getJoinFieldsLeft().size());
assertEquals(meta.getKeyFields2().length, node.getJoinFieldsRight().size());
Iterable<StreamFieldNode> usedFields = node.getStreamFieldNodesUses();
for (StreamFieldNode usedField : usedFields) {
boolean isOnLeft = node.getJoinFieldsLeft().contains(usedField.getName());
boolean isOnRight = node.getJoinFieldsRight().contains(usedField.getName());
assertTrue(isOnLeft || isOnRight);
assertTrue(usedField.getFieldNodesThatIJoinTo() != null);
assertTrue(usedField.getFieldNodesThatJoinToMe() != null);
}
Iterable<StreamFieldNode> outputFields = node.getOutputStreamFields();
assertEquals(getExpectedOutputFieldCount(meta), getIterableSize(outputFields));
for (StreamFieldNode outputField : outputFields) {
// these should have derives links
assertTrue(outputField.getFieldNodesThatDeriveMe() != null);
}
}
Aggregations