3 ms·
Interesting. This syntax reminds me a bit of the R package data.table's terseness for joins: B[A, on="x"] # A left join B B[A] # same, assuming x is the ke
by orhmeh09 3y ago
Interesting. This syntax reminds me a bit of the R package data.table's terseness for joins:
B[A, on="x"] # A left join B
B[A] # same, assuming x is the key column on both, like K's lj [x;y]
A[B, on=.(x, y<=foo)] # right non-equi join
- nivertech 3y agoThat's because kdb tables are much more similar to R dataframes (ordered maps of vectors), rather than to relational algebra used in RDBMS/SQL (logically sets of rows). That's for in-memory only (RDB), ignoring historical data (HDB) and persistence since kdb is a real database. // kdb+/q t: ([] sym:`AAPL`IBM`GOOG; price: 139.09 124.23 948.82; vol: 123456 98765 54321) # R df <- data.frame(sym=c("AAPL", "IBM", "GOOG"), price=c(139.09, 124.23, 948.82), vol=c(123456, 98765, 54321))