apache / apache/hop

[Feature Request]: Drools Accumulator - Inject vs. modify row

Open
#2,426 0 comments 0 reactions 0 assignees View on GitHub
awaiting triage P3 Transforms
Dominant language
Java
Stars
1.5k
Forks
476
Avg merge
18h 33m
Merged PRs (30d)
204

Description

### What would you like to happen?
Migration: https://issues.apache.org/jira/browse/HOP-4096

Hello, I placed a comment in commit for HOP
https://github.com/apache/hop/commit/2e757440c4654b58299324229a4c6b51d1e3ca38#diff-eac62f95891a0ff873fef552a12d204d83fb852db04850c10b57ebfb13c84e46R158

I Think that collecting resultList is not implemented with support of all DRL functions: 
https://docs.drools.org/7.68.0.Final/drools-docs/html_single/index.html#drl-rule-units-con_drl-rules

Drools for hop does not support modify existing row from variable memory
Only rows which are injected to WorkMemory directly with inject(row) are available in output of drools accumulator.
But it is not valid behaviour, there are use cases when accumulator modifies existing ones.

the problem could be workarounded if 
inject(new Row($originalRow))  would work
however there is no Constructor in Row Class (Rule.java)

we have version 2.0. HOP

### Issue Priority

Priority: 3

### Issue Component

Component: Transforms

Contributor guide

Open the contributing guide

Research direction

Start with the referenced HOP commit and the Drools rule-unit documentation, then inspect Rule.java and the accumulator handling around resultList. Determine how modified rows from variable memory are currently treated; done means rows modified by the accumulator are included in its output, including the described Row workaround if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
data-engineering
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.