eugenegujing opened a new issue, #7759:
URL: https://github.com/apache/texera/issues/7759
### What happened?
`JoinOperator` is the hash-join example shipped with the Python engine and
the only dual-input example operator. Port 0 builds the hashmap, port 1 probes
it, and a match is emitted by concatenating the two tuples:
```python
# amber/src/main/python/pytexera/udf/examples/join_operator.py:29-38
@overrides
def process_tuple(self, tuple_: Tuple, port: int) ->
Iterator[Optional[TupleLike]]:
if port == 0:
# building the hashmap
self.left_dict[tuple_["key"]].append(tuple_)
else:
# probing the hashmap
for left_tuple in self.left_dict.get(tuple_["key"], []):
# join and output
yield left_tuple + tuple_
```
`core.models.Tuple` implements no `__add__`/`__radd__`, so `left_tuple +
tuple_` raises unconditionally. The only branch of the example that produces
output — the whole point of a join — has never worked; a user who copies the
example into a dual-input Python UDF gets a crash on the first match.
**Expected:** merged tuples on each match. **Actual:** `TypeError` (log
below).
It is also the only example operator without a spec:
`pytexera/udf/examples/` holds six operators and
`src/test/python/pytexera/udf/examples/` has specs for the other five.
### How to reproduce?
Run against `amber/src/main/python`:
```python
from core.models import Tuple
left = Tuple({"key": 1, "a": "x"})
right = Tuple({"key": 1, "b": "y"})
left + right
```
Or in the UI: feed a `DualInputPortsPythonUDFV2` carrying the example code
verbatim from two sources that share a key value — the workflow fails on the
first match with the same TypeError in the operator console.
### Version/Branch
1.3.0-incubating-SNAPSHOT (main)
### Commit Hash (Optional)
_No response_
### What browsers are you seeing the problem on?
_No response_
### Relevant log output
```shell
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]