[Bug]: Import from kettle Simple Mapping wrong filename (trans_name)
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 476
- Avg merge
- 19h
- Merged PRs (30d)
- 227
Description
### Apache Hop version?
2.9.0
### Java version?
11.0.15
### Operating system
Windows
### What happened?
Import a "Simple mapping (sub-transformation)" step will not have the transformation name set in Hop (pipeline transform).
- The filename element is empty.
- The directory_path element is set relative to the kettle repository. This will probably not be a valid file path in Hop. And this element is probably not used.
- The trans_name element is set but probably not used.
An additional problem is caused by https://github.com/apache/hop/pull/3426. Because the filename element is empty a nullpointer exception occurs when trying to save the Hop transform, even after filling in a Pipeline name in the dialog:
```
java.lang.NullPointerException
at java.base/java.util.regex.Matcher.getTextLength(Matcher.java:1770)
at java.base/java.util.regex.Matcher.reset(Matcher.java:416)
at java.base/java.util.regex.Matcher.(Matcher.java:253)
at java.base/java.util.regex.Pattern.matcher(Pattern.java:1133)
at org.apache.hop.pipeline.transforms.mapping.SimpleMappingDialog.ok(SimpleMappingDialog.java:775)
at org.apache.hop.pipeline.transforms.mapping.SimpleMappingDialog.lambda$open$1(SimpleMappingDialog.java:192)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
at org.apache.hop.ui.core.dialog.BaseDialog.defaultShellHandling(BaseDialog.java:522)
at org.apache.hop.pipeline.transforms.mapping.SimpleMappingDialog.open(SimpleMappingDialog.java:302)
at org.apache.hop.ui.hopgui.file.pipeline.delegates.HopGuiPipelineTransformDelegate.editTransform(HopGuiPipelineTransformDelegate.java:173)
at org.apache.hop.ui.hopgui.file.pipeline.HopGuiPipelineGraph.editTransform(HopGuiPipelineGraph.java:3420)
at org.apache.hop.ui.hopgui.file.pipeline.HopGuiPipelineGraph.mouseUp(HopGuiPipelineGraph.java:962)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:224)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:89)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4256)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1066)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4054)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3642)
at org.apache.hop.ui.hopgui.HopGui.open(HopGui.java:475)
at org.apache.hop.ui.hopgui.HopGui.main(HopGui.java:352)
```
### Issue Priority
Priority: 3
### Issue Component
Component: Hop Gui, Component: Import
Contributor guide
Research direction
Start with the import handling for a Simple mapping and the failing path at org.apache.hop.pipeline.transforms.mapping.SimpleMappingDialog.java:775. Reproduce the import using the reported Hop 2.9.0 setup, then inspect how filename, directory_path, and trans_name are populated. Done means the imported pipeline has a usable transformation name and saving it no longer throws the reported NullPointerException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100