Search code examples
kdb

NYI error when attempting to perform a union join


I am attempting to join a single-columned table to another table with several columns. The only column in the first table matches the title and type of the first column of the second table, but it has more values as the second table filters on a bigger master table and this single column takes all distinct values from the master for the specific column.

I want to return a table that shows all these distinct values, with the data from the second table stitched on, and NULL values where there is no data. As such, I try a union join:

nameList uj tbl;

But then I get hit with the below error unexpectedly:

nyi: Not yet implemented

I had a look at the documentation and I cannot wrap my head around what it means and what I am doing wrong. I attempted to add a dummy column to the first table so that I can key it but the join still does not work.

Could anyone please advise what I might be missing here?


Solution

  • An lj may be what you need instead

    q)nameList:([] a:2 3 4 5)
    q)tbl:([] a:3 4;b:6 7;c:8 9)
    q)nameList
    a
    -
    2
    3
    4
    5
    q)tbl
    a b c
    -----
    3 6 8
    4 7 9
    q)nameList lj 1!tbl
    a b c
    -----
    2
    3 6 8
    4 7 9
    5