Advertisement
Guest User

Untitled

a guest
Jul 5th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  create
  2.     or replace view entities_seen_on_kafka_only as select
  3.         kafka.entity_id,
  4.         kafka.entity_type,
  5.         kafka.entity_path,
  6.         kafka.seen_at,
  7.         kafka.data
  8.     from
  9.         reconciliation as kafka
  10.     left outer join reconciliation as data_lake on
  11.         kafka.entity_id = data_lake.entity_id
  12.         and data_lake.seen_on = 'Data-Lake'
  13.     where
  14.         kafka.seen_on = 'kafka'
  15.         and exists(
  16.             select
  17.                 *
  18.             from
  19.                 reconciled_entity_types
  20.             where
  21.                 kafka.entity_type = reconciled_entity_types.entity_type
  22.         )
  23.         and data_lake.entity_id is null;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement