2022.06.09 11:22 AM
1. how to push data to KDB using qpython?
2. is there any script to push data to HDB? assume I have lots of dated trade data, how can I push data to kdb by setting trade date as the data of HDB.
2022.06.09 06:06 PM
1. Doing this via qpython is no different from those via other interfaces (including q itself): you open a connection (e.g. to tickerplant, assuming a tp+rdb+hdb setup) and call a function that will get your data persisted (e.g. .u.upd[`trade; data]).
2. Generally speaking, backpopulating historical data in a right way isn't straightforward: it could be done as simple as splaying data using set, one for each partition (date), if you have complete data to write; if you've got partial data to write (e.g. trades for a new instrument type), you may have to re-sort the combined data and re-apply attributes wherever needed. The q language itself is short of higher-level APIs that handles the nuances, but I find TorQ has a good collections of those, which makes the task easier.
2022.06.10 03:15 AM
An example data publisher is included in documentation https://qpython.readthedocs.io/en/latest/usage-examples.html#data-publisher
For going straight to HDB you can write a custom
.u.upd yourself to write direct
Or use a file based batch load approach to backfill.
Tel: +44 (0)28 3025 2242
Tel: +1 (212) 447 6700
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.