mirror of
https://github.com/rasilon/ujetl.git
synced 2026-04-11 10:29:29 +00:00
Add test config
This commit is contained in:
parent
8fdbc6a78e
commit
4f905dd47a
2 changed files with 58 additions and 4 deletions
|
|
@ -98,5 +98,59 @@
|
|||
OR denormalised_personalia.lname is distinct from EXCLUDED.lname
|
||||
</insert>
|
||||
</job>
|
||||
<job>
|
||||
<name>test pre post</name>
|
||||
<key>select -1 as key</key>
|
||||
<select>
|
||||
select
|
||||
id,
|
||||
test_int,
|
||||
test_text,
|
||||
test_ts
|
||||
from
|
||||
public.source where id > ?::bigint
|
||||
</select>
|
||||
<preTarget>
|
||||
drop table if exists tmp_dest;
|
||||
create temp table tmp_dest(
|
||||
id bigint,
|
||||
test_int integer,
|
||||
test_text text,
|
||||
test_ts timestamp with time zone
|
||||
);
|
||||
</preTarget>
|
||||
<insert>
|
||||
insert into tmp_dest(
|
||||
id,
|
||||
test_int,
|
||||
test_text,
|
||||
test_ts
|
||||
)values(
|
||||
?::bigint,
|
||||
?::integer,
|
||||
?::text,
|
||||
?::timestamp with time zone
|
||||
)
|
||||
</insert>
|
||||
<insert>
|
||||
insert into public.dest(
|
||||
id,
|
||||
test_int,
|
||||
test_text,
|
||||
test_ts
|
||||
)
|
||||
select id,test_int,test_text,test_ts
|
||||
from tmp_dest
|
||||
ON CONFLICT(id) DO UPDATE
|
||||
set
|
||||
test_int = EXCLUDED.test_int,
|
||||
test_text = EXCLUDED.test_text,
|
||||
test_ts = EXCLUDED.test_ts
|
||||
WHERE
|
||||
dest.test_int IS DISTINCT FROM EXCLUDED.test_int
|
||||
OR dest.test_text IS DISTINCT FROM EXCLUDED.test_text
|
||||
OR dest.test_ts IS DISTINCT FROM EXCLUDED.test_ts
|
||||
</insert>
|
||||
</job>
|
||||
</jobs>
|
||||
</CopyingApp>
|
||||
|
|
|
|||
|
|
@ -180,12 +180,12 @@ public class Job extends Thread {
|
|||
|
||||
log.info(String.format("%s - Processing table: %s",jobName,name));
|
||||
if(preTarget != null){
|
||||
log.debug("Trying to execute preTarget SQL");
|
||||
log.info("Trying to execute preTarget SQL");
|
||||
PreparedStatement s = dConn.prepareStatement(preTarget);
|
||||
s.executeUpdate();
|
||||
s.close();
|
||||
}else{
|
||||
log.debug("No preTarget; skipping.");
|
||||
log.info("No preTarget; skipping.");
|
||||
}
|
||||
|
||||
log.debug("Trying to execute: "+key);
|
||||
|
|
@ -225,12 +225,12 @@ public class Job extends Thread {
|
|||
c.join();
|
||||
|
||||
if(postTarget != null){
|
||||
log.debug("Trying to execute postTarget SQL");
|
||||
log.info("Trying to execute postTarget SQL");
|
||||
PreparedStatement s = dConn.prepareStatement(postTarget);
|
||||
s.executeUpdate();
|
||||
s.close();
|
||||
}else{
|
||||
log.debug("No postTarget; skipping.");
|
||||
log.info("No postTarget; skipping.");
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue