Questions tagged [kdb]

kdb+ is a proprietary high-performance database developed by Kx Systems.

kdb+ is a proprietary high-performance database developed by KX.

Features

  • Scalable column-oriented database for massive data volumes
  • Manages real-time and historical data in one platform
  • A single system allowing for low latency communication between kdb+ processes
  • Coupled with the expressive q programming and query language

It comes with a programming language called q (or kdb/q). Both q and kdb are written in the k language which has the tag on this site.

More Information

KX have recently launched the KX Community, a site moderated daily by KX employees to ensure all questions are answered. For any questions, on q/kdb+ or any of the KX technology and products, our KX experts are on hand to help!

2014 questions
0
votes
1 answer

KDB+/Q: best way to reconstruct orderbook from historical level/price updates?

Given the following data spec: q) ob src sym price size side time ---------------------------------------------------------- 1 2 930700 439 -1 2020.06.20D00:00:00.053000000 1 2 930708 444 -1 …
James
  • 1,260
  • 13
  • 25
0
votes
2 answers

kdb: best way to delete all rows from a table

Given table t:([c1:1 2]c2:3 4) I've come across two ways of clearing its content: t:0#t delete from `t Apart from the fact that option (2) returns symbol t, are there other differences between the two?
kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80
0
votes
2 answers

kdb - sending large CSV from local to server

All, I'm having some trouble sending a large csv-based tables (6 cols x 1mm+ rows) table to my server. I can bring tables back from my server with no issues. I've tried a few methods but presently I'm trying to read the csv and send it over as a…
Jason_L
  • 427
  • 1
  • 3
  • 12
0
votes
2 answers

kdb string path miss quotation mark

I would like to join strings for file name and shell script so I can run the command line in kdb for ftp transfer. But there are quotations in quotation marks. not sure how to add / in there. This is the code I…
Terry
  • 523
  • 9
  • 21
0
votes
2 answers

kdb - KDB Apply logic where column exists - data validation

I'm trying to perform some simple logic on a table but I'd like to verify that the columns exists prior to doing so as a validation step. My data consists of standard table names though they are not always present in each data source. While the…
Jason_L
  • 427
  • 1
  • 3
  • 12
0
votes
2 answers

How to ignore error/exception during process of a list?

Learning kdb+q. Without loss of generality, let's say if I have a list of file paths and wants to open each one of them, but I want to make sure Q opens whatever it exists. Say if one of the file paths doesn't exist, then continue to process…
Gary
  • 1,828
  • 1
  • 20
  • 27
0
votes
2 answers

kdb: Use \l to load a data file (table vs list)

In examples provided by https://code.kx.com/q4m3/11_IO/#1113-serializing-and-deserializing-q-entities I found that I can use \l to load back a table, but cannot load back a list. Am I missing something, or does \l only support loading back data of…
kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80
0
votes
2 answers

kdb: How to display entire list in console?

How may I display an entire list, or control the number of elements displayed, on the console? I tried show and searched a bit but am unsure where to look next. q)til 100 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28…
kgf3JfUtW
  • 13,702
  • 10
  • 57
  • 80
0
votes
1 answer

How to know the handle of the client that disconnects form a q service triggering the .z.pc function, kdb+

I have to log disconnects and I am defining a .z.pc function to do this. However, I'm unsure how to best to get the handle of the process that has disconnected. I do record the handle and host, when it connects, using the .z.po function. Any insight…
Chris
  • 31
  • 5
0
votes
1 answer

How to build a parse-tree of projections?

I want to save somehow a parse-tree into a text format file, than bring it back to q. But a parse-tree could possibly contains projections, say +[;1]2. How should I process these file trees and correctly save/load it? I've got errors trying to work…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
1 answer

Could not evaluate manually created equial ~ parse tree

How could it be an equality of manually created parse tree and the result of parse operation: q)t:([]date:.z.d+til 5;ccy:5#`EUR`CAN`AUS;fx:5?(1.0 0.1)) q)@[;`date;1+]t date ccy fx ------------------ 2020.11.01 EUR 0.1 2020.11.02 CAN…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
1 answer

Select distinct for all columns from keyed table

It seems we can not get distinct values from a keyed table in the same way as for unkeyed: t:([a:1 2]b:3 4) ?[t;();0b;()] // keyed table ?[0!t;();1b;()] // unkeyed table ?[t;();1b;()] // err 'type Why do we have this error here?
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
2 answers

KDB/Q: How to write a function for select by

We know we can write a function like select avg val by category from tab But what if I need to write a complicated customized functions like select myfunc by category from tab where here myfund will compute with multiple columns in the tab. for…
Matt Frank
  • 177
  • 6
0
votes
2 answers

How can we use iterators in q to apply a list of functions to each of a list of arguments?

In q/kdb, we can apply a function to a number of arguments, as below: f each (1;2;3) We can also apply a defined argument to a list of functions: flist: (f1:{x+y+z},f2:{x+y-z},f3:{x-y+z}); flist .\: 1 2 3 What is the most efficient way to combine…
0
votes
1 answer

Delete the oldest record from KDB table based on client pair match

I am looking to write a function to remove a row from the below table if the reverse client pair exists in the table (eg if cd1/cd2 has a cd2/cd1 matching pair) I would like to remove the oldest record and keep the newest. To make it more clear I…
pmade1
  • 21
  • 4