为什么写入数据到dolphindb的dfs表没有报错但是写入失败

我用下面的语句向dolphindb的dfs表写入数据,没有报错,但是却没有新的数据写入到指定的dfs表,请问怎么回事?

login("admin", "123456")

if(existsDatabase("dfs://db1")){
    dropDatabase("dfs://db1")
}

n=1000000
month=take(2000.01M..2016.12M, n)
x=rand(1.0, n)
t=table(month, x)
db=database("dfs://db1", VALUE, 2020.01M..2021.12M)
pt = db.createPartitionedTable(t, `pt, `month)
pt.append!(t)

select count(x) from pt;

返回:

image

有时候用api也会出现这样的情况,比较困惑,请问是什么导致的?

请先 登录 后评论

1 个回答

Jax Wu

DolphinDB的配置文件中有一个newValuePartitionPolicy参数,单节点server在dolphindb.cfg文件中配置,集群server在cluster.cfg中配置。如果未设置该参数,则默认值是skip,表示当写入数据超过分区数据库创建时指定的范围时,自动过滤掉这些数据,不写入数据库。

目前可以通过两种方式增加新的值分区:
1.将配置参数newValuePartitionPolicy设定为add。在单节点server中,该参数在dolphindb.cfg中配置。在集群server中,该参数在cluster.cfg中配置。
2.使用addValuePartitions函数

请先 登录 后评论