0

I have seen this question, but I think my issue is a bit different : kdb splayed table meta error

I am saving a table splayed in a location with the following command :

pthToSplayed upsert .Q.en[pthtohdbroot;] table

I don't have any sym so nothing gets enumerated (.Q.en is there because in the future it might have some symbols).

All works well, but when I try to do meta select from get[pathToTable] where date = .z.d I get a ..sym error.

However, the strange part is that the first time I am saving the table down ... the meta works fine. when I exit and start the proc again the problem seems to appear. what exactly happens here? I would appreciate links to a whitepaper or kx website which explains where this issue comes from.

UPDATE: Nothing weird about the meta of the table. just a vanilla meta.

`:/home/user/hdbroot/tableName/ set .Q.en[`:/home/user/hdbroot;] table

As I am updating this table I am using upsert instead of set for subsequent operations.

Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
  • Hi, can you give a little bit more information: can you show the meta of your `table`, can you show (approximately) what `pthToSplayed`, `pthtohdbroot` and `pathToTable` look like? – terrylynch Aug 31 '21 at 08:40

1 Answers1

0

Your issue is that the enumeration file named sym needs to be loaded in to the process memory.

If you load the folder using \l you will not have the issue:

q)\l hdbRoot

Or you can explicitly load the sym file:

q)tableName:get `:hdbRoot/tableName/
q)sym:get `:hdbRoot/sym

The reason it works before a restart is because .Q.en automatically loads sym in to memory for you when you call it.

If there are no symbol columns there should be no error.

Save table with no symbol column:

$q
q)`:hdbRoot/tableName/ set .Q.en[`:hdbRoot] ([] a:1 2 3)
`:hdbRoot/tableName/
q)\\

New session meta works:

$q
q)tableName:get `:hdbRoot/tableName/
q)meta tableName
c| t f a
-| -----
a| j

You can check the types of each column to confirm there are no enumerations:

q)type each flip tableName

Prior to V3.6 of kdb+, the type of an enumeration could range from 20h to 76h, with each new domain given an incremented type. In V3.6 onwards all enumerations 20h

If any column is a symbol type, even if empty then a sym file is created:

q)`:hdbRoot/tableName/ set .Q.en[`:hdbRoot] ([] a:`long$();b:`$())
`:hdbRoot/tableName/
q)get `:hdbRoot/sym
`symbol$()
rianoc
  • 2,015
  • 8
  • 9
  • but the sym file is not even created because there are no symbol columns in the table –  Aug 31 '21 at 10:40
  • I added code to the answer so you can check and confirm you have no symbol type columns. – rianoc Aug 31 '21 at 11:04