KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ Save creating 3 files

  • Save creating 3 files

    Posted by ekallivrousis on March 11, 2022 at 12:00 am

    For some reason when i use the save command on a table it creates 3 files. It didnt used to do this. Is there a new way to use it?

     

    -rw-rw-r–. 1 desadm desadm 1742704 Mar 10 20:14 ot
    -rw-rw-r–. 1 desadm desadm 167004504 Mar 10 20:14 ot#
    -rw-rw-r–. 1 desadm desadm 161406 Mar 10 20:14 ot##

    ekallivrousis replied 8 months, 1 week ago 3 Members · 2 Replies
  • 2 Replies
  • rocuinneagain

    Member
    March 11, 2022 at 12:00 am

    Can you include a small reproducible piece of code?

    I do not see the files being created.

    //Including kdb+ version information 
    //If behaviour has changed include previous version information also 
    q).z.k 2021.07.12 
    q).z.K 4f 
    //An example table
    q)ot:([]a:1 2 3;b:`a`b`n;c:("jj";"kk";"pp")) 
    q)save `ot `:ot 
    //No # or ## files created by `save` keyword 
    q){x where x like "ot*"}key `:. ,`ot

     

    The # and ## files you see are used by the anymap datatype on disk.

    You can still read your file with

    get `:ot

     

  • cathan

    Member
    March 11, 2022 at 12:00 am

    From https://code.kx.com/q4m3/14_Introduction_to_Kdb%2B/#1423-splayed-tables-with-nested-columns :

    When you splay a table with compound columns, q creates not one but two files for each compound column. … If you examine these files you will discover that the sharp file contains the binary data of the original list in flattened form and the non-sharp file is a serialized q list of integers representing the lengths of each sublist of the original list.

    In this case, I think your column is doubly compounded which creates both a ot# and ot## file. As the other answerer says, you should be able to use get on the “non-sharped” file just fine.

Log in to reply.