From d93fa016a5d62adea57789f8abe018d527ea551c Mon Sep 17 00:00:00 2001 From: Matt Casters Date: Fri, 5 Feb 2021 16:43:12 +0100 Subject: [PATCH] HOP-2500 : Show last rows widget is showing incorrect data --- .../ui/hopgui/file/pipeline/HopGuiPipelineGraph.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java index dfd8477f861..1f6b1c8c14c 100644 --- a/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java +++ b/ui/src/main/java/org/apache/hop/ui/hopgui/file/pipeline/HopGuiPipelineGraph.java @@ -30,6 +30,7 @@ import org.apache.hop.core.action.GuiContextAction; import org.apache.hop.core.exception.HopException; import org.apache.hop.core.exception.HopTransformException; +import org.apache.hop.core.exception.HopValueException; import org.apache.hop.core.extension.ExtensionPointHandler; import org.apache.hop.core.extension.HopExtensionPoint; import org.apache.hop.core.gui.AreaOwner; @@ -4143,6 +4144,16 @@ public void rowWrittenEvent(IRowMeta rowMeta, Object[] row) } } + // Clone the row to make sure we capture the correct values + // + if (sampleType != SampleType.None) { + try { + row = rowMeta.cloneRow(row); + } catch (HopValueException e) { + throw new HopTransformException("Error copying row for preview purposes", e); + } + } + switch (sampleType) { case First: {