I want to create views in greenplum HAWQ using a simple talend job, that would basically have a fileinput that contains all the views then I need to execute the CREATE VIEW script.
Since these views (50-60.000) come from an oracle system I need to find the ones that we were unable to create.
Here's a mock up for my problem:
I have a view already in the DB, and I want to create it 3 more times. This would obviously fail.
Here's the output:
Exception in component tGreenplumRow_2
org.postgresql.util.PSQLException: ERROR: relation "ad_apps_dependencies" already exists
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1592)
.--------------.
| tLogRow_4 |
|=------------=|
|componenterror|
|=------------=|
|componenterror|
'--------------'
.-----------------------------------------------------+-------------------------------------------------------------.
| tLogRow_5 |
|=----------------------------------------------------+------------------------------------------------------------=|
|result |result1 |
|=----------------------------------------------------+------------------------------------------------------------=|
|ERROR: relation "ad_apps_dependencies" already exists|CREATE VIEW SYSTEM.AD_APPS AS SELECT * FROM APPLSYS.AD_APPS|
'-----------------------------------------------------+-------------------------------------------------------------'
.------------.
| tLogRow_6 |
|=----------=|
|subjobError |
|=----------=|
|Subjob Error|
'------------'
I want to have this output 3 times, as I try to run 3 times the query. (In the final version I'd create another file that contains only the queries that failed, so we can fix it later, but this is a crucial point.)
As a workaround: I could move this tRow -> OnError -> FixedFlow -> FailedViews part into a different job, but thats not an elegant solution.