-
Notifications
You must be signed in to change notification settings - Fork 353
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]: The "Database Lookup" step trim function does not seem to work #2806
Comments
In which transform you put 'trim - both' on the field? |
Hi. I just tried a very similar pipeline and the database lookup trim worked. My environment is Hop 2.4.0 (March, 26 snapshot), Windows and jdk-11.0.15.10. Could you please share the exact version of Java and the stream metadata after the look up (you can add a "Metadata structure of stream" transform and share the output of that). |
My environment is: hop 2.4.0 (2023-03-27 07.51.24) Metadata output: Two sample lines from the database input: L1995-06-7018 MON_DAT is analysedatum. Feitelijke MON_DAT is onbekend Two sample lines from the database input: So if copy/paste works the same, it looks newline related. The two trims do not do the same function with respect to newlines. |
I had a look at the code and I confirm that the two transforms does the same thing in a different way. Apart from this, regarding the newline character in the output, that could be acceptable so I'm not conridering the behavior as a bug. The idea could be to add a new option parameter to let the user decide if the newline char must be removed by the trim or not. In that case we can change the type of the issue from bug to feature request. @hansva what do you think? |
You could also make it a documentation issue. Make clear what trimming does in each case. But I would prefer to have 'trim' have a single meaning everywhere. |
@duursma I agree with you and we will take care about that but, apart from this techincal detail, we must decide how to manage the newline char. Someone could disaagree about removing the newline char, someone else could agree (like you for example). Who knows. Therefore the idea of providing a configuration option to guide that choice seems to be the best one. |
I disagree with adding an option. Trim should be as simple as a java String.Trim() and should be uniform everywhere. |
Apache Hop version?
2.4.0
Java version?
11
Operating system
Windows
What happened?
I select a number of records from a database with a field know to have trailing spaces/newlines. After enabeling 'trim - both' on the field the trailing whitespace remains. After including a "String operation" step with the trim option set to 'both' the trailing whitespace does disappear.
Issue Priority
Priority: 3
Issue Component
Component: Database
The text was updated successfully, but these errors were encountered: