可以用分布式计算完成
tb=loadTable("dfs://min","min_kline") // 定义map函数 def sampleMap(t) { x=select date,code, "m_h_0931_1451" as name, max(high_min) as high_min from t context by code csort dt asc limit -1; return x } //第一种方法 timer{ resultTB=table(1:0,`date`code`m_h_0931_1451`high_min,[DATE,SYMBOL,STRING,DOUBLE]) for (year in sort(distinct(yearBegin(2008.01.01..2021.01.01)))){ print(year) ds = sqlDS(<select * from tb where date(dt) between year:temporalAdd(year,1,"y") and second(dt) between 09:31:00:14:52:00>) // 创建数据源 res=mr(ds, sampleMap, , unionAll) // 执行计算 resultTB.append!(select * from res) } } //第二种方法 ds = sqlDS(<select date,code,high_min,dt from tb where date(dt)>2008.01.01 and date(dt)<2021.08.03 and second(dt) between 09:31:00:14:52:00>) // 创建数据源 timer res=mr(ds, sampleMap, , unionAll) // 执行计算