と の 2 つのテーブルがbiz_date
ありholiday
ます。
create table biz_date (t_date string,start_date string,biz_day int)
create table holiday (h_date string)
ここで、biz_date テーブルの各行の t_date と start_date の間にある h_date の数を数え、それを biz_day から減算します。biz_day はその月の営業日、start_date は t_date の月の開始日です。例: biz_date 1990-02-06 1990-02-01 4
この hiveql クエリを試しました
select b.t_date,b.biz_day,b.biz_date-cnt,h.h_date,
if(b.start_date>=h_date && b.t_date> h.h_date) then count(h_date)as cnt
from biz_date b,holiday h;