DolphinDB错误报告:连接被拒绝



每次尝试基于多个条件进行选择时都会引发错误。我使用的代码是:

tb=loadTable("dfs://min","min_kline")
m=select date, code, "m_h_0931_1451" as name, max(high_min) from tb where date(dt)>=2008.01.01 and date(dt)<2021.08.01 and second(dt) >= 09:31:00 and 14:52:00 context by code, date, csort dt asc limit-1

我认为DolphinDB的分布式计算将有助于解决这个问题。

tb=loadTable("dfs://min", "min_kline")
// define a udf 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
}
// first method
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>) // create data source
res = mr(ds, sampleMap, unionAll) // execute calculation
resultTB.append!(select * from res)
}
}
// second method
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>) // create data source
timer res = mr(ds, sampleAmp, unionAll) // execute calculation

最新更新