Skip to content

Emitting multiple fields from R doesn't work as expected #4

@filip-andrei

Description

@filip-andrei

If tuple$output only contains a single element, then everything looks as expected.
However if output is a multi-element vector, the output is still a single-element list in which that element is also a list containing all of the emitted items:

t$output = vector(mode="character", length=4);

for(i in 1:3){
t$output[i] = t$input[i];
} t$output[4] = as.numeric(t$input[3]) > 200;

s$emit(t);

produces the following log:
14282 [Thread-18] INFO backtype.storm.daemon.executor - Processing received message source: spout:5, stream: default, id: {}, [test, 01.01.2003 01:39:00, 4597]
14292 [Thread-27] INFO backtype.storm.daemon.task - Emitting: operationalFilter default [["test","01.01.2003 01:39:00","4597","TRUE"]]

This poses a problem if there's any field grouping to be done on that bolt's output.

EDIT:
A related issue would also be that if t$output[i] is also a multi-element vector, only the first element gets added to the output:

t$output[1] = c(1, 2, 3);
t$output[2] = c("A", "B", "C");

s$emit(t);

produces:
8917 [Thread-23] INFO backtype.storm.daemon.task - Emitting: operationalFilter default [["1","A"]]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions