Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: If field value is null - not working for me

  1. #1
    Join Date
    Nov 2007
    Posts
    15

    Question If field value is null - not working for me

    PDI 3.2 has this new step "If field value is null".

    I am trying to use it in a transformation:

    Access Input -> Add constants -> If field value is null -> Table output Mapping -> Table output (which is a MySQL table)

    For those fields in the MySQL table that accept NULL I'd like to change to UNDEFINED so this step seems ideal.

    So in the step I select "Select fields" and specify a handful of fields under the Fields section and specify the "Replace by value" value. I have specified and not specified a "Conversion mask (Date)". Is the Conversion mask necessary? In all cases I still have NULL written into fields in the MySQL table. All the MySQL fields that accept NULL are varchars.

    There is not much on this step in the wiki:

    http://wiki.pentaho.com/display/EAI/...+value+is+null

    A previous post about this step:

    http://forums.pentaho.org/showthread.php?t=70745

    doesn't conclude with any advice pertaining to this particular step.

    Am I doing something wrong?

    Thanks in advance.

    Cheers

  2. #2
    Join Date
    Nov 2007
    Posts
    15

    Default Replace Null for all fields - Text file output works

    So far the only way I can get this step to work is if I use the global "Replace Null for all fields" (which is fine for my use case) and write out a text file.

    I'm not sure why it won't work with my MySQL table.

    As the other poster mentioned can use Value Mapper to achieve desired goal but I'm left wondering why "If field value is null" doesn't work for me.

    Cheers


  3. #3

    Default

    Hi,

    can you please attached a sample (transformation & access mdb if possible).

    Thanks a lot
    Samatar

  4. #4
    Join Date
    Nov 2007
    Posts
    15

    Default Test case

    Thanks for looking into this.

    I've attached a MDB that has one row from the source Access DB/table as well as the transformation and SQL to create output MySQL table.

    After running the transformation the website field for the row in the MySQL table is NULL instead of UNDEFINED.

    Cheers
    Attached Files Attached Files
    Last edited by blender; 07-23-2009 at 03:29 PM.

  5. #5

    Default

    Thanks al ot :-)
    I opened a bug here :

    http://jira.pentaho.com/browse/PDI-2555


    Thanks again

    Samatar
    Samatar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.