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

Data validator fails when variable is passed in Regular expression expected to match

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Severity: Medium
    • Resolution: Fixed
    • Affects Version/s: 4.2.0 GA (4.0.0 GA Suite Release)
    • Fix Version/s: 5.1.0 GA
    • Component/s: Step
    • Labels:
      None
    • Story Points:
      3
    • PDI Sub-component:
    • 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.
    • Sprint Team:
      Pervach
    • Operating System/s:
      Windows Vista

      Description

      Create a new transformation
      Create a transformation parameter,say parameter1 from transformation settings and add any regular expression as the default value
      one i used was for date format validation :
      ^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/((1[6-9]|[2-9]\d)\d

      {2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((1[6-9]|[2-9]\d)\d{2}

      ))|((0[1-9]|1\d|2[0-8])\/02\/((1[6-9]|[2-9]\d)\d

      {2}

      ))|(29\/02\/((1[6-9]|[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])00))))$

      Add a data grid step, add a single string column to it, add one row of data (any value)
      Add a data validator step, and create a validation for the column added in the data grid step.
      Under the text field "Regular expression expected to match", add the parameter reference -> ${parameter1}

      Preview the transformation.

      The transformation fails with error:

      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : java.util.regex.PatternSyntaxException: Illegal repetition near index 0
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : ${parameter1}
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : ^
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.error(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.closure(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.sequence(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.expr(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.compile(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.<init>(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.util.regex.Pattern.compile(Unknown Source)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at org.pentaho.di.trans.steps.validator.Validator.init(Validator.java:497)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at org.pentaho.di.trans.step.StepInitThread.run(StepInitThread.java:52)
      2011/11/11 16:07:43 - Data Validator.0 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : at java.lang.Thread.run(Unknown Source)
      2011/11/11 16:07:43 - Transformation 1 - Step [Data Grid.0] initialized flawlessly.
      2011/11/11 16:07:43 - Transformation 1 - ERROR (version 4.2.0-GA, build 15694 from 2011-08-24 11.46.44 by buildguy) : Step [Data Validator.0] failed to initialize!

        Attachments

          Activity

            People

            Assignee:
            jdorlus John Dorlus (Inactive)
            Reporter:
            madhupenta Madhukiran J
            Votes:
            2 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: