bvt123 / SCH

GNU General Public License v3.0
1 stars 4 forks source link

loader processor #8

Open bvt123 opened 9 months ago

bvt123 commented 9 months ago

For loading data from an external DB (like MySQL) we can use insert ... select technique to pull data from the remote server. The source table should have an updated_at DatimeTime column and index on it.

with (select max(updated_at) from dest) as max
select * from mysql(db1,table=XXX) where created >= max and created < now() - delay

"last" position will be updated not by the processor (it doesn't know it), but by MV connected to the dest table step here should be the number of seconds, not rows.

source table could be any string that will be substituted by the template processor:

The topic is always ready to run and only repeat timeout stops it from executing continuously.