use of org.pentaho.metaverse.api.StepField in project pentaho-kettle by pentaho.
the class GetXMLDataStepAnalyzer method getChangeRecords.
@Override
public Set<ComponentDerivationRecord> getChangeRecords(GetXMLDataMeta meta) throws MetaverseAnalyzerException {
Set<ComponentDerivationRecord> changes = new HashSet<>();
boolean isInFields = meta.isInFields();
boolean isAFile = meta.getIsAFile();
boolean isAUrl = meta.isReadUrl();
// if we are getting xml from a field, we need to add the "derives" links from the xml to the output fields
if (isInFields && !isAFile && !isAUrl) {
GetXMLDataField[] fields = baseStepMeta.getInputFields();
if (getInputs() != null) {
Set<StepField> inputFields = getInputs().getFieldNames();
for (StepField inputField : inputFields) {
if (inputField.getFieldName().equals(meta.getXMLField())) {
// link this to all of the outputs that come from the xml
for (GetXMLDataField field : fields) {
ComponentDerivationRecord change = new ComponentDerivationRecord(meta.getXMLField(), field.getName());
changes.add(change);
}
break;
}
}
}
}
return changes;
}
use of org.pentaho.metaverse.api.StepField in project pentaho-kettle by pentaho.
the class JsonInputAnalyzer method getUsedFields.
@Override
protected Set<StepField> getUsedFields(final JsonInputMeta meta) {
Set<StepField> usedFields = new HashSet<>();
if (meta.isAcceptingFilenames() && StringUtils.isNotEmpty(meta.getAcceptingField())) {
final Set<String> inpusStepNames = getInputStepNames(meta, meta.getAcceptingField());
for (final String inpusStepName : inpusStepNames) {
final StepField stepField = new StepField(inpusStepName, meta.getAcceptingField());
usedFields.add(stepField);
}
}
return usedFields;
}
use of org.pentaho.metaverse.api.StepField in project pdi-dataservice-server-plugin by pentaho.
the class DataServiceStepValidationTest method mockOriginSteps.
private void mockOriginSteps(String expectedStepName, Collection<String> fieldNames) throws MetaverseException {
Map<String, Set<StepField>> stepFieldMap = Maps.newHashMap();
int i = 0;
for (String fieldName : fieldNames) {
stepFieldMap.put(fieldName, ImmutableSet.of(new StepField("originStepName" + i, "originFieldName" + i++)));
}
when(lineageClient.getOriginSteps(eq(checkStepsExtension.getTransMeta()), eq(expectedStepName), any(Collection.class))).thenReturn(stepFieldMap);
}
Aggregations