Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Can't inject "Group field" field in "Row denormaliser" transform #2102

Closed
enricomariam42 opened this issue Dec 22, 2022 · 3 comments
Closed
Assignees
Labels
bug P3 Nice to have
Milestone

Comments

@enricomariam42
Copy link
Contributor

Apache Hop version?

SNAPSHOT-20221221

Java version?

openjdk version "11.0.9.1" 2020-11-04 OpenJDK Runtime Environment (build 11.0.9.1+1-post-Uos-1deb10u2) OpenJDK 64-Bit Server VM (build 11.0.9.1+1-post-Uos-1deb10u2, mixed mode, sharing)

Operating system

Linux

What happened?

Injecting "Group field" with a constant value in "Row denormaliser" transform has no effect and the group is missing in the injected transform.

Workaround: define the group in a field (e.g. in a "Add constants" transform) and select that in the metadata injection transform.

(Migrated from https://issues.apache.org/jira/browse/HOP-3860)

injection.zip

The attached pipeline denormalizer_template.hpl containing a "Row denormaliser" is injected in the two ways:

  • with a constant value inject_denormalizer_not_working.hpl produce injected_denormalizer_no_group.hpl
  • with the group in a field inject_denormalizer_working.hpl produce injected_denormalizer_with_group.hpl

Obtained (output of injected_denormalizer_no_group.hpl):

group SNS SERVIZI SAN RicaviSan
3A120 -13576,2 -322,8 3,5

Espected (output of injected_denormalizer_with_group.hpl):

group SNS SERVIZI SAN RicaviSan
3A120     3,5
2G112 -13576,2 -322,8

Issue Priority

Priority: 3

Issue Component

Component: Metadata

@hansva
Copy link
Contributor

hansva commented Dec 23, 2022

.take-issue

@hansva
Copy link
Contributor

hansva commented Dec 23, 2022

Bit of an annoying issue, for lists it expects data rows as it does not really know how many fields to add when using a constant. I'm leaning towards "works as intended". Though I understand the edge case when you only need 1 value

@enricomariam42
Copy link
Contributor Author

I understand. Letting input a constant value lead to an unexpected behavior, though.
So, block the use of a constant filed if lists expected, or map a constant to a single value list, or split it to a list of fields based on special char can be possible?
I don't think document it is enough, even if there is a way around.

@hansva hansva added this to the 2.5 milestone Mar 23, 2023
@hansva hansva closed this as completed in b82b48a Mar 29, 2023
hansva added a commit that referenced this issue Mar 29, 2023
Add support for constants on empty lists, fixes #2102
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug P3 Nice to have
Projects
None yet
Development

No branches or pull requests

2 participants