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
2 answers

Populate null value with preceding values for multiple columns without specifying column names

I have a table containing 30+ columns, each of which has quite a few null values for records. To fill null values with preceding values, I use fills function and specify each column name in update statement as follows at the moment. (The below…
howard
  • 13
  • 2
0
votes
1 answer

How does the random state propagate to different threads when using peach?

I'm trying to understand how the random state propagates to the threads when using peach but can't find much documentation on it. Empirically, from the test below, it seems like the threads do end up with different seeds but these seeds may be…
apoursh
  • 27
  • 5
0
votes
1 answer

Multiple variable assignment in q

This code looks like multiple variable assignment: d:`a`b`c!1 2 3 d[`a`b]:10 20 Why is it working this way? And why it is not the same as (a;b):10 20 (which doesn't work)? I suppose the 2nd line will make only temporary assignment - do not actually…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
3 answers

KDB/Q: add two tables based on the value of column(s)

I have 2 tables with the same columns. however, one table contains BUY data while the other contains SELL data. The first column of the table is the ID, and the number of rows of the tables might not be the same. How do I add the values of the…
duckman
  • 687
  • 1
  • 15
  • 30
0
votes
1 answer

KDB - reformatting date

I'm formatting dates between day format YYYY.MM.DD and Monthly YYYY.MM and having some issues recasting data back and forth. Per Shock and Awe, I understand that the YYYY.MM format needs to be an integer however I'm having issues casting it…
Jason_L
  • 427
  • 1
  • 3
  • 12
0
votes
2 answers

What is the name of this q/kdb+ feature? Does any flavor of LISP implement it? How?

The q programming language has a feature (which this tutorial calls "function projection") where a function of two or more parameters can be called with fewer parameters than it requires, but the result is an intermediate object, and the function…
Gabi
  • 413
  • 2
  • 8
0
votes
2 answers

KDB+/Q: How to group rows by a given columns scalar value into discrete bins for further aggregation?

Given a set of price buckets (of varying sizes) as follows: buckets:( 1000.0 1000.4 1000.9 1001.6 1002.5 1003.6 1004.9 1006.4 1008.1 1010; // min bucket price 1000.4 1000.9 1001.6 1002.5 1003.6 1004.9 1006.4 1008.1 1010 1012.1 // max bucket…
James
  • 1,260
  • 13
  • 25
0
votes
2 answers

Select a table from the inside of external select

I've seen a technique of use an update (mainly for side-effect of adding a new column, I guess) in a way of: update someFun each t from t. Is it good or bad practice to use such technique? Some experiments: t1:([]a:1 2); t2:([]a:1 2;b:30 40); update…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
1 answer

User the kdb+ timer with an IPC handle

I'm trying to connect to an RDB from a client and get a row count for one of the tables every x seconds using the .z.ts timer function. So assuming my RDB is listening on port 5011 then my q code looks something like this: h:hopen…
Chris
  • 31
  • 5
0
votes
1 answer

KDB - Troubleshooting ungrouping or raze on large datasets?

I'm using KDB to take a bunch of formulas, and generate temporal data of monthly data upwards to ~1200months per formula. I'm scaling up my code and running it on larger data sets and running into rank errors and I'm having a time troubleshooting. I…
Jason_L
  • 427
  • 1
  • 3
  • 12
0
votes
1 answer

NULLs in q and in k.h

I've found different values for h NULLs between k.h and q: q)0x00 vs 0W 0x7fffffffffffffff q)0x00 vs 0N 0x8000000000000000 q)0x00 vs 0Ni 0x80000000 q)0x00 vs 0Wi 0x7fffffff q)0x00 vs 0Wh 0x7fff q)0x00 vs 0Nh 0x8000 In q it all looks familiar, but…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
2 answers

Select when one of filter-column may not exists

Suppose a situation when it is not known if a filter column exists. t:([]a:`s1`s2`s3; c:1 2 3); select c from t where null t[`a] select c from t where null t[`b] 'length (where null t[`a])~where null t[`b] 1b It column a exists, then the select is…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
2 answers

all subsets of lists in KDB+

I am new to KDB. I have a table in following format: id date name order 34 2020.01.20 John 10 23 2020.01.20 John -20 21 2020.01.20 John 30 43 2020.01.20 John -400 44 2020.01.20 Dan -6483 22 2020.01.20 Dan …
Gerry
  • 606
  • 6
  • 16
0
votes
1 answer

What is the meaning of `s attribute on a table?

In the Abridged Q Language Manual Arthur mentioned: `s#table marks the table to use binary search and marks first column sorted And if we look into 3.6 version: N:1000000; t1:t2:([]n:til N; m:N?`6); t1:update `p#n from t1; t2:`s#t2; (meta t1)[`n]`a…
egor7
  • 4,678
  • 7
  • 31
  • 55
0
votes
2 answers

'select count' returns "OS reports: No such file or directory"

I get this "./2017.10.14/:./2017.10.15/tableName. OS reports: No such file or directory" when I try to do select count i by date from tableName where date within(.z.d-5;.z.d) works if I do select colName from trackFeedStats where date…
user10165841
1 2 3
99
100