Skip to content

Commit

Permalink
modify process to the return value of method RecordTransformerRules.…
Browse files Browse the repository at this point in the history
…loadTransformerRules()
  • Loading branch information
baisui1981 committed Sep 7, 2024
1 parent 5a952d4 commit 42e4b3e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions core/src/main/java/com/alibaba/datax/core/job/TransformerUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.function.Function;

/**
Expand Down Expand Up @@ -91,9 +92,12 @@ static TransformerBuildInfo buildTransformerInfo(IJobContainerContext containerC
TransformerInfo transformerInfo = null;
TransformerExecution texec = null;
IPluginContext pluginContext = IPluginContext.namedContext(containerContext.getCollectionName());
RecordTransformerRules transformers = RecordTransformerRules.loadTransformerRules(
Optional<RecordTransformerRules> transformersOpt = RecordTransformerRules.loadTransformerRules(
pluginContext, tabRelevantTransformer);
if (CollectionUtils.isEmpty(transformers.rules)) {
RecordTransformerRules transformers = null;
if (transformersOpt == null
|| (transformers = transformersOpt.orElseThrow(() -> new IllegalStateException("tabRelevantTransformer:" + tabRelevantTransformer + " relevant transformersOpt must be present"))) == null
|| CollectionUtils.isEmpty(transformers.rules)) {
throw new IllegalStateException("transformer:" + tabRelevantTransformer + " can not be empty");
}

Expand Down Expand Up @@ -129,6 +133,11 @@ public List<IColMetaGetter> originColsWithContextParams() {
return transformerCfg.originColsWithContextParams();
}

@Override
public List<IColMetaGetter> tranformerColsWithoutContextParams() {
return transformerCfg.tranformerColsWithoutContextParams();
}

@Override
public boolean containContextParams() {
return transformerCfg.containContextParams();
Expand Down

0 comments on commit 42e4b3e

Please sign in to comment.