Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-2816

Number Ranges step incorrect saved to repository (loaded from repository)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Unknown
    • Resolution: Fixed
    • Affects Version/s: 3.2.0 GA
    • Fix Version/s: 3.2.3, 4.0.0 GA
    • Component/s: Step
    • Labels:
      None
    • Environment:
      Windows XP Pro; PostgreSQL 8.3 as repository storage, Kettle 3.2 GA
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      Java exception stack trace while loading transformation from repository. Investigate, that its related to "Number ranges" step:
      error reading step with id_step=7 from the repository
      at org.pentaho.commons.launcher.Launcher.main (Launcher.java:116)
      at java.lang.reflect.Method.invoke (null:-1)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
      at sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
      at org.pentaho.di.ui.spoon.Spoon.main (Spoon.java:412)
      at org.pentaho.di.ui.spoon.Spoon.start (Spoon.java:5574)
      at org.pentaho.di.ui.spoon.Spoon.readAndDispatch (Spoon.java:945)
      at org.eclipse.swt.widgets.Display.readAndDispatch (null:-1)
      at org.eclipse.swt.widgets.Display.runDeferredEvents (null:-1)
      at org.eclipse.swt.widgets.Widget.sendEvent (null:-1)
      at org.eclipse.swt.widgets.EventTable.sendEvent (null:-1)
      at org.pentaho.xul.swt.menu.MenuChoice.handleEvent (MenuChoice.java:73)
      at org.pentaho.xul.swt.menu.MenuChoice.handleMenuEvent (MenuChoice.java:77)
      at org.pentaho.xul.swt.menu.Menu.handleMenuEvent (Menu.java:117)
      at org.pentaho.xul.swt.menu.MenuBar.handleMenuEvent (MenuBar.java:52)
      at org.pentaho.xul.EventHandler.handleMenuEvent (EventHandler.java:44)
      at java.lang.reflect.Method.invoke (null:-1)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (null:-1)
      at sun.reflect.NativeMethodAccessorImpl.invoke (null:-1)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (null:-2)
      at org.pentaho.di.ui.spoon.Spoon.lastFileSelect (Spoon.java:1278)
      at org.pentaho.di.ui.spoon.Spoon.loadLastUsedFile (Spoon.java:5651)
      at org.pentaho.di.ui.spoon.Spoon.loadLastUsedFile (Spoon.java:5679)
      at org.pentaho.di.ui.trans.dialog.TransLoadProgressDialog.open (TransLoadProgressDialog.java:89)
      at org.eclipse.jface.dialogs.ProgressMonitorDialog.run (ProgressMonitorDialog.java:495)
      at org.eclipse.jface.operation.ModalContext.run (ModalContext.java:313)
      at org.eclipse.jface.operation.ModalContext.runInCurrentThread (ModalContext.java:369)
      at org.pentaho.di.ui.trans.dialog.TransLoadProgressDialog$1.run (TransLoadProgressDialog.java:77)
      at org.pentaho.di.trans.TransMeta.<init> (TransMeta.java:2442)
      at org.pentaho.di.trans.TransMeta.<init> (TransMeta.java:2517)
      at org.pentaho.di.trans.step.StepMeta.<init> (StepMeta.java:632)
      at org.pentaho.di.trans.steps.numberrange.NumberRangeMeta.readRep (NumberRangeMeta.java:191)
      at java.lang.Double.parseDouble (null:-1)
      at sun.misc.FloatingDecimal.readJavaFormatString (null:-1)

      I'm check sources for 3.2.0 GA, 3.2.3 & trunk branches. Error in NumberRangeMeta class, readRep method.

      I can't check issue against other DB & platform, but think, that it would be same.

      IMHO, reason, that attribute values readed as String (lines 186-187) (attributes named as "lower_bound" & "upper_bound"), than converted to Double.
      But, when step saves to repository, it store values as Double (and into BIGINT "value_num" column for step), lines 217-218.
      So, when attributes saved, it stored to value_num, but when reading, it reads from value_str.

      Proposal fix:
      =========== lines 217-218, file NumberRangeMeta.java, change to:

      rep.saveStepAttribute(id_transformation, id_step, i,"lower_bound", String.valueOf(rule.getLowerBound())); //$NON-NLS-1$
      rep.saveStepAttribute(id_transformation, id_step, i,"upper_bound", String.valueOf(rule.getUpperBound())); //$NON-NLS-1$
      ===========
      I'm not sure, probably this also fix issue, reported at forum: http://forums.pentaho.org/showthread.php?t=70014&highlight=number+range+step

        Attachments

          Activity

            People

            • Assignee:
              gdavid Golda Thomas
              Reporter:
              anvl Andrey Lazarev
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: