What's the best wait to halt a graph if a certain component returns no rows/results?

Support/help with CloverETL (4.9) and CloverDX (5.0 or newer) implementation problems

KyleMoseley
Posts: 2
Joined: Thu Sep 10, 2015 1:08 pm

What's the best wait to halt a graph if a certain component returns no rows/results?

Postby KyleMoseley » Tue Sep 15, 2015 3:35 pm

Right now I've got a SQL query that sometimes returns no results. When it doesn't, I want the graph to end. What's the best way to address that? Preferably a non-coded solution.

imriskal
Posts: 397
Joined: Wed Aug 15, 2012 8:18 am

Re: What's the best wait to halt a graph if a certain component returns no rows/results?

Postby imriskal » Thu Sep 17, 2015 1:33 pm

Hello Kyle,

As you already discussed with my colleague via email, you can modify your SQL query and add a fake record in case the original query returns 0 records. See Getting SELECT to return a constant value even if zero rows match

This fake record can contain an identifier and ExtFilter can redirect it wherever you want. Or, if you have only one stream of data, DBInputTable returning 0 records means that all components after DBInputTable will end automatically and successfully.
---
Lubos Imriska
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com

KyleMoseley
Posts: 2
Joined: Thu Sep 10, 2015 1:08 pm

Re: What's the best wait to halt a graph if a certain component returns no rows/results?

Postby KyleMoseley » Thu Sep 17, 2015 1:42 pm

Or, if you have only one stream of data, DBInputTable returning 0 records means that all components after DBInputTable will end automatically and successfully.


This is more my situation. I have two queries that are running in parallel. Query A and Query B both fire (seperate connectors/edges). But if Query B fires and returns nothing, I would like Query A to not even attempt to fire.


[query A]----[transformations & store a certain val to dictionary]-----[trash]

[query b]-------[transform]---[inject dictionary value]------[insert statement]

imriskal
Posts: 397
Joined: Wed Aug 15, 2012 8:18 am

Re: What's the best wait to halt a graph if a certain component returns no rows/results?

Postby imriskal » Fri Sep 18, 2015 1:05 pm

If this is the case, I recommend splitting the two streams into separate graphs. Then you can orchestrate them using a jobflow and send values between them using either parameters or temp files (depending on size of the data transferred).
---
Lubos Imriska
CloverCARE Support
CloverDX

Visit us online at http://www.cloverdx.com


cron