S02019

错误代码

S02019

报错信息

The column to be sorted cannot be an array vector. RefId:S02019

错误原因

因 array vector 类型数据不能进行排序,所以在 context by 子句的 csort 中不支持指定这种类型的列,若指定为 array vector 类型,则会出现该报错。见下例:

bid = array(DOUBLE[], 0, 20).append!([1.4799 1.479 1.4787, 1.4796 1.479 1.4784, 1.4791 1.479 1.4784])
ask = array(DOUBLE[], 0, 20).append!([1.4821 1.4825 1.4828, 1.4818 1.482 1.4821, 1.4814 1.4818 1.482])
TradeDate = 2022.01.01 + 1..3
SecurityID = rand(`APPL`AMZN`IBM, 3)
t = table(SecurityID as `sid, TradeDate as `date, bid as `bid, ask as `ask)

select sum(bid) from t context by sid csort ask

解决办法

检查脚本中是否在 csort 子句中指定了 array vector 类型列,若有则需要删除该子句,或者重新修改脚本以实现相应的逻辑。