use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class TransExecutorStepAnalyzer method connectToSubTransInputFields.
/**
* Add links from all incoming stream fields to the fields in the sub transformation
* @param meta
* @param subTransMeta
* @param subTransNode
* @param descriptor
*/
protected void connectToSubTransInputFields(TransExecutorMeta meta, TransMeta subTransMeta, IMetaverseNode subTransNode, IComponentDescriptor descriptor) {
Set<StepField> incomingFields = getInputs().getFieldNames();
for (StepField field : incomingFields) {
IMetaverseNode inputNode = getInputs().findNode(field);
linkUsedFieldToSubTrans(inputNode, subTransMeta, subTransNode, descriptor);
}
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class LineageClientIT method testGetOriginSteps.
@Test
public void testGetOriginSteps() throws Exception {
Set<StepField> originStepsSet;
Map<String, Set<StepField>> originSteps;
originSteps = client.getOriginSteps(transMeta, "Select values", Arrays.asList("HELLO"));
assertNotNull(originSteps);
assertEquals(1, originSteps.size());
originStepsSet = originSteps.get("HELLO");
assertNotNull(originStepsSet);
assertEquals(2, originStepsSet.size());
// We're not sure which step will be in which order, but both fields are named COUNTRY
for (StepField stepField : originStepsSet) {
assertEquals("COUNTRY", stepField.getFieldName());
}
originSteps = client.getOriginSteps(transMeta, "Passthru", Arrays.asList("COUNTRY", "COUNTRY_1"));
assertNotNull(originSteps);
assertEquals(2, originSteps.size());
for (Set<StepField> originStepsSetValues : originSteps.values()) {
assertNotNull(originStepsSetValues);
assertEquals(2, originStepsSetValues.size());
// We're not sure which step will be in which order, but both fields are named COUNTRY
for (StepField stepField : originStepsSetValues) {
assertEquals("COUNTRY", stepField.getFieldName());
}
}
originSteps = client.getOriginSteps(transMeta, "Select values", Arrays.asList("COUNTRY", "COUNTRY_1", "HELLO"));
assertNotNull(originSteps);
assertEquals(1, originSteps.size());
for (String stepName : originSteps.keySet()) {
// Only HELLO will return values
if (!"HELLO".equals(stepName)) {
assertEquals(0, originSteps.get(stepName).size());
} else {
Set<StepField> originStepsSetValues = originSteps.get(stepName);
assertNotNull(originStepsSetValues);
assertEquals(2, originStepsSetValues.size());
// We're not sure which step will be in which order, but both fields are named COUNTRY
for (StepField stepField : originStepsSetValues) {
assertEquals("COUNTRY", stepField.getFieldName());
}
}
}
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class ExcelInputStepAnalyzer method getUsedFields.
@Override
protected Set<StepField> getUsedFields(ExcelInputMeta meta) {
Set<StepField> usedFields = new HashSet<>();
if (meta.isAcceptingFilenames() && StringUtils.isNotEmpty(meta.getAcceptingStepName())) {
StepField stepField = new StepField(meta.getAcceptingStepName(), meta.getAcceptingField());
usedFields.add(stepField);
}
return usedFields;
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class TextFileInputStepAnalyzer method getUsedFields.
@Override
protected Set<StepField> getUsedFields(TextFileInputMeta meta) {
Set<StepField> usedFields = new HashSet<>();
if (meta.isAcceptingFilenames() && StringUtils.isNotEmpty(meta.getAcceptingStepName())) {
StepField stepField = new StepField(meta.getAcceptingStepName(), meta.getAcceptingField());
usedFields.add(stepField);
}
return usedFields;
}
use of org.pentaho.metaverse.api.StepField in project pentaho-metaverse by pentaho.
the class FilterRowsStepAnalyzer method getUsedFields.
@Override
protected Set<StepField> getUsedFields(FilterRowsMeta meta) {
// add uses links to all of the fields that are part of the filter condition
Set<StepField> usedFields = new HashSet<>();
final Condition condition = meta.getCondition();
if (condition != null) {
for (String usedField : condition.getUsedFields()) {
usedFields.addAll(createStepFields(usedField, getInputs()));
}
}
return usedFields;
}
Aggregations