cancel
Showing results for 
Search instead for 
Did you mean: 

As-of join on a splayed/partitioned table?

jkm
New Contributor

  I have an in-memory table myt holding trades (created using ([] ...)) and a historical database mhdb holding market data in a splayed partitioned table md. I start q, load my trades table from a csv file into memory, then map the hdb database (using \l myhdb) and attempt to perform an as-of join on column time on the two tables: 

    aj[`time;myt;md]

  I get the message `splay. When I load the persisted table into memory (tt:select bpx1, opx1 from md) and THEN join the in-memory table tt with trades myt, the as-of join works fine. 

  Am I doing something wrong in trying to join the persisted market data table with the in-memory trades table or is this a limitation of q?  
2 REPLIES 2

sohagan857
New Contributor
Yes, you need to map the on disk data into memory first - see remark(2) here http://code.kx.com/wiki/Reference/aj#Remarks

so 

aj[`sym`time;myt;select .. from myd where ...] 

Sean


jkm
New Contributor

  Sean, thank you, worked like a charm!