Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: How to detect if a filtered result set is not empty?

  1. #1

    Default How to detect if a filtered result set is not empty?

    Hi!

    What's the best way to detect if a filtered result set is not empty? I simply want to generated a XML / Text file out of the result only, if the result set is not empty.

    Thanks!

    Thomas

  2. #2
    Join Date
    Feb 2009
    Posts
    321

    Default

    whole row or a particular field of that row? for a row use the step filter rows

  3. #3
    Join Date
    Apr 2008
    Posts
    4,696

    Default

    I think Thomas is asking how to tell if a stream is empty *AFTER* a filter rows step.

    Most of the steps don't do anything if there's no input step (empty stream), though the Text File Output will create a 0 length file on initialization.

    I'm not sure of a way to keep that from happening, since it happens before the data stream occurs.

    Perhaps a JIRA feature request?

  4. #4
    Join Date
    Jul 2009
    Posts
    24

    Default Detect empty stream step

    Good afternoon,
    If you are using 3.2 GA there is a Detect empty stream step. I was not able to find docs about it beyond the description that it will output one empty row if the input stream does not contain any values. It may be possible to use this step along with addition filter or switch case to achieve your desired functionality.

  5. #5
    DEinspanjer Guest

    Default

    Quote Originally Posted by gutlez View Post
    Most of the steps don't do anything if there's no input step (empty stream), though the Text File Output will create a 0 length file on initialization.

    I'm not sure of a way to keep that from happening, since it happens before the data stream occurs.

    Perhaps a JIRA feature request?
    Actually, there is a checkbox on the TFO dialog to specifically avoid creating the file on initialization. If that checkbox is enabled, the file won't be created until the first row of data is received by the step.

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.