Questions tagged [q-lang]

The q language is a programming language by kx.com for querying kdb+ databases.

Q was developed by Arthur Whitney in 2003 and is built on top of the K programming language. The names q and kdb+ are often used interchangeably, but generally q refers to the programming language and kdb+ refers to the entire runtime environment.

245 questions
1
vote
1 answer

How to create KDB query which groups by time interval and do not bring RDB down?

We receive quotes from exchange and store them in KDB Ticker Plant. We want to analyze volume in RDB and HDB with minimum impact on performance of these database since they are also used by other teams. Firstly, how we may create a function which…
user3914448
  • 469
  • 1
  • 11
  • 22
1
vote
2 answers

How to insert element between other elements in KDB/Q list

Say I have a list (1 3 4) and after 1 I want to insert another element 2 resulting in (1 2 3 4). How can this be done efficiently in a generic way?
user3914448
  • 469
  • 1
  • 11
  • 22
1
vote
2 answers

pandas DataFrame drops index when passing to kdb+ (using qPython API)

I am trying to pass time-series data from Python to q/kdb+. One solution out there is qPython module, offering seamless conversion from q table/dictionary to Pandas. The problem is when trying to pass from Pandas to q, the time index in DataFrame…
Daniel Krizian
  • 4,586
  • 4
  • 38
  • 75
1
vote
2 answers

Use a function in the groupby clause of a functional select

Is it possible to include a function in the groupby section of functional select, similar to how the aggregations work? For example how would I turn select by `long$`timespan$04:00 xbar time from table into functional select?
nightTrevors
  • 639
  • 4
  • 11
  • 24
1
vote
1 answer

Multithreaded rdb in kdb

I have some memory constraints in my current 32-bit kdb+/tick setup,in which my rdb consumes by far the most. I know I can get around the 4 GB 32-bit addressability limit by using multiple threads with a -s tag on initialization of the q process,…
nightTrevors
  • 639
  • 4
  • 11
  • 24
1
vote
1 answer

Why does KDB Ticker Plant need a log file?

The KDB Ticker Plant process has a log file which keeps data for a second. Why does it need a log file in a first place? What is the purpose of it?
user3914448
  • 469
  • 1
  • 11
  • 22
1
vote
2 answers

No such host is known using AquaQ

I am trying to set up a production environment for KDB using AquaQ. I have set up the appropriate Environment Variables and modified the process.csv file to have my IP in it. When I try and load torq.q I get the error: cannot create alias on…
Roni Hoffman
  • 302
  • 1
  • 5
  • 17
1
vote
3 answers

Difference when you query from KDB HDB and KDB RDB

I heard that there is a difference when you query (select, etc.) from HDB and RDB (in-memory) databases. Is it possible to describe all possible scenarios when we should use HDB specific queries and RDB specific queries and how to query: i.e.…
user3914448
  • 469
  • 1
  • 11
  • 22
1
vote
1 answer

How to append a single element to a list keyed in a dict

If I have dict:`a`b!(1 2 3;4 5 6 7) Can I append an element to dict`b without redeclaring the whole dict? ie what's the best way to get to dict:`a`b!(1 2 3;4 5 6 7 8)
nightTrevors
  • 639
  • 4
  • 11
  • 24
1
vote
1 answer

kdb one-item list not initializing

I'm working through the Kx Technology Training Course, and there's a line that says "Enlist applies to all data objects; the result for any data object is a one-item list whose item is that object. For example" enlist(2 5;3.5 10 12) ,(2 5;3.5…
hedgedandlevered
  • 2,314
  • 2
  • 25
  • 54
1
vote
1 answer

KDB Query with OR condition like in SQL

In SQL I may write query with logical (true and true) or (true and true), i.e: select * from t1 inner join t2 on ... where (t1.a != t2.a and t1.b != t2.b) or (t1. != t2.a and t1.b != t2.b) when I try to do it in Q like this select from ej[....]…
user3914448
  • 469
  • 1
  • 11
  • 22
1
vote
1 answer

How does vmem parameter impact a kdb-q service

Here is what I did: Ran a q process with a limiting vmem argument (say in a 100GB system, running vmem of 50GB) Logged a unix top command After the entire process was completed, I was trying to analyse the memory usage. I saw that the process %age…
Pratyush
  • 71
  • 1
  • 10
1
vote
1 answer

kdb simple table join unexpected result

I am trying out the example on how to join two tables found at http://code.kx.com/q/ref/lists/#join The example shows: t:([]a:1 2 3;b:`a`b`c) r:([]c:10 20 30;d:1.2 3.4 5.6) show t,`r with this as the result: a b c d ---------- 1…
Hopper06
  • 89
  • 2
  • 10
1
vote
1 answer

kdb Update entire column with data from another table

I have two partitioned tables. Table A is my main table and Table B is full of columns that are exact copies of some of the columns in Table A. However, there is one column in Table B that has data I need- because the matching column in Table A is…
Hopper06
  • 89
  • 2
  • 10
1
vote
2 answers

KDB:selecting data “around” time of certain events Part2

Follow up to this question... KDB:selecting data "around" time of certain events Consider a huge table of market data T. I am particularly interested in rows where Status=`SSS. However, in addition to the rows given by (select from T where…
bigO6377
  • 1,256
  • 3
  • 14
  • 28