DolphinDB:由于错误“用于值分区的列不能包含 NULL 值”而无法写入 DFS 表

问题描述 投票:0回答:1

写入数据库时出现以下错误如何解决:

Exception in writeCandlestick: 127.0.0.1:8503 Server response: 'The column used for value-partitioning cannot contain NULL values. RefId:S01001' script: 'tableInsert{loadTable('dfs://candle_db', 'candles')}'.

error-handling null dolphindb
1个回答
0
投票

创建值分区数据库时,分区列中不允许使用 NULL 值,因为系统无法确定应将 NULL 分配给哪个分区。为了解决这个问题,可以将分区列的数据写入到内存表中,检查是否包含NULL值。这是一个示例脚本:

t=table(7 8 9 as id, 1.1 1.2 NULL as val)
select * from t where val is null
// output
id val
-- ---
9
© www.soinside.com 2019 - 2024. All rights reserved.