kdb+k

FK field over IPC


Some prerequisites on the remote process:

q)\p 15222
q)t:([id:10 20 30]data:`aa`bb`cc);
q)kt:([]id:`t$10 20 20 30 30 30; num:til 6);

and the following will be performed on a local process:

  1. The size of kt looks the same from both sides:
q)-22!`::15222 "kt"
138
q)`::15222 "-22!kt"
138
  1. But meta's are different:
q)`::15222 "meta kt"
c  | t f a
---| -----
id | j t
num| j
q)meta `::15222 "kt"
c  | t f a
---| -----
id | j
num| j

Why is it so? - why the transferred table does not contain a whole information as its source (despite of the sizes are the same)?


I suspect this somehow related to enums - q completely removes enum info - is it true?:

// remote
q)e:`a`b`c;
q)e1:`e$`b`a`c`c`a`b;
// local
q)`::15222 "type e1"
20h
q)type `::15222 "e1"
11h

Solution

  • Yes, enums (and thus foreign keys) aren't preserved when transported over IPC to another process.

    Equal length from -22! doesn't mean identical content.