Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- drop table if exists kdz17.etl_load_weather_facts_00;
- create table if not exists kdz17.etl_load_weather_facts_00 as
- select
- min(loaded_ts) as ts1,
- max(loaded_ts) as ts2
- from kdz17.src_weather_facts
- where loaded_ts > coalesce((select max(loaded_ts) from kdz17.etl_weather_facts), '1970-01-01');
- drop table if exists kdz17.etl_load_weather_facts_01;
- create table if not exists kdz17.etl_load_weather_facts_01 as
- select distinct
- icao_code,
- local_datetime,
- t_air_temperature,
- p0_sea_lvl,
- p_station_lvl,
- u_humidity,
- dd_wind_direction,
- ff_wind_speed,
- ff10_max_gust_value,
- ww_present,
- ww_recent,
- c_total_clouds,
- vv_horizontal_visibility,
- td_temperature_dewpoint,
- loaded_ts
- from kdz17.src_weather_facts, kdz17.etl_load_weather_facts_00
- where loaded_ts between ts1 and ts2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement