我使用以下代码,目的是想使用tableInsert往一个分布式表插入数据,但是报错了。
login("admin", "123456")
if(!existsDatabase("dfs://test")){
t = table(
array(STRING, 0) as x1,
array(STRING, 0) as x2,
array(STRING, 0) as x3,
array(INT, 0) as value,
array(DATE, 0) as date,
array(TIME, 0) as time,
array(TIMESTAMP, 0) as timestamp)
a = database(, VALUE, 2000.01.01..2030.12.31);
b = database(, HASH, [STRING, 5]);
db = database("dfs://test", COMPO, [a, b]);
pt = db.createPartitionedTable(t, "pt", `timestamp`x3);
}
pt = loadTable("dfs://test", "pt")
v=(NULL, '3101', 'B.USDCNH.CPR=CFES', NULL, 2020.11.30, 16:30:03.000, 2020.11.30T23:59:56.000)
tableInsert(pt, v)
错误提示:
Can't append data to a segmented table that contains external partitions.
请问是哪里不对?
DolphinDB中的tableInsert函数目前还不能直接把一个vector直接插入到一个分布式表中,可以先通过tableInsert把vector插入到一个内存表,再把内存表里的数据插入到分布式表中: