LAE

Welcome to the LAE community!  Please feel free to start a discussion in the discussion tab or join in a conversation.

Discussions

Members

Resources

Events

 View Only
  • 1.  Field Validation for Source Files

    Employee
    Posted 07-21-2014 04:00

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: sree

    Hi Team,

    If my source file column order is wrong or Few columns are missing from my source file ,how can i perform field validation.

    Regards,
    Sree


  • 2.  RE: Field Validation for Source Files

    Employee
    Posted 07-22-2014 02:44

    Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.

    Originally posted by: Tim Meagher

    Hi,

    I'm not sure I quite understand the problem regarding to the source file column order being wrong or what you would be trying to catch there, since it probably depends on the input data format and whether column order is actually relevant there.
    If you want to check if columns are missing from your data, there are numerous ways to do this.
    I've attached a graph with 3 possible ways to do this (although there are no doubt more ways to check the same thing).

    First, you can create a static data node which just contains the metadata you require and cat this together (with a ConcatenationType of Exact) with your input data.
    The node will error if the metadata specified in the static data node isn't present in the data.
    However, you need to specify all of the fields present in the data in your static data node.

    Second, you could use a filter and use the "try" operator, together with the "field" operator to try and obtain the value for a field.
    If the field doesn't exist, this will error, and the failureExpression in the try operator (in this case an "abort" statement) will be executed, meaning the node will fail.

    Third, and probably the best and easiest solution would be to use a Meta Check node and just specify the fields you are expecting to see in the data.

    Tim.
    Attachments:
    CheckFieldExists.brg