flipkart-incubator / flipkart-incubator/databuilderframework

DataFlowExecutor's databuilderFactory is not used

Open
#48 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
40
Forks
28
PR merge metrics
No merged PRs in 30d

Description

I am creating a `SimpleDataFlowExecutor` with a custom DataBuilderFactory.
`DataFlowExecutor executor = new SimpleDataFlowExecutor(myDataBuilderFactory);`
However, when I run a dataflow with this executor the factory set in the constructor of DataFlowExecutor is not used.
The databuilderFactory of dataFlow takes precedence over the executor's builderFactory.
https://github.com/flipkart-incubator/databuilderframework/blob/master/src/main/java/com/flipkart/databuilderframework/engine/DataFlowExecutor.java#L57
```
public DataExecutionResponse run(DataFlow dataFlow, DataDelta dataDelta) throws DataBuilderFrameworkException, DataValidationException {
Preconditions.checkNotNull(dataFlow);
Preconditions.checkArgument(null != dataFlow.getDataBuilderFactory() || null != this.dataBuilderFactory);
return this.run(new DataBuilderContext(), new DataFlowInstance(), dataDelta, dataFlow, dataFlow.getDataBuilderFactory());
}
```
**Suggestion:** If dataflow's builderFactory is null, exectuor's factory can be used.
So whenever i have to run the dataflow, i have to explicitly set the databuilderFactory and then call run.
```
dataFlow.setDataBuilderFactory(myDatabuilderFactory);
result = executor.run(dataFlow, data);
```
Also the default factory set in DataFlowBuilder is `MixedDataBuilderFactory`. So can't really use this DataFlowBuilder to create a DataFlow.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.