如何在 kdb+ 中批量更新插入

How to bulk upsert in kdb+

可以批量更新插入分区 table。我尝试了几种语法组合并且 none 有效。

例如

`:2015.12/calls/ upsert (1; 4389; 2015.12.01T07:56:50) // single upsert works
`:2015.12/calls/ upsert (1 2; 4389 4397; 2015.12.01T07:56:50 2015.12.01T07:56:58) // do not work
`:2015.12/calls/ upsert ((1; 4389; 2015.12.01T07:56:50);(2; 4397; 2015.12.01T07:56:58)) // do not work.

谢谢

您需要upsert一个table即:

/ substitute `COL1`COL2`COL3 with actual column names
`:2015.12/calls/ upsert flip `COL1`COL2`COL3!(1 2; 4389 4397; 2015.12.01T07:56:50 2015.12.01T07:56:58)