You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7 lines
475 B

tbl = loadTable("dfs://hft_stock_ts", 'KLinePartitioned')
// TODO: m_nDate filter in where clause need to be replaced by group by
total_vol = select code, m_nDate, sum(m_nVolume) as total_vol from tbl where m_nDate=2015.01.05 group by code
tail_vol = select code, m_nDate, sum(m_nVolume) as tail_vol from tbl where m_nDate=2015.01.05 and m_nTime>=14:30:00 group by code
select code, m_nDate, tail_vol/total_val as tail_vol_ratio from ej(total_val, tail_vol, `code`m_nDate)