KX Community

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

Home Forums kdb+ Q chk cannot work

  • Q chk cannot work

    Posted by renbright on August 14, 2023 at 12:00 am

    I added another two new columns to the existing kdb table and use Q chk to back fill the HDB. But somehow, no data was back filled and still got error when query HDB.

     

    how to fix this?

    renbright replied 1 month, 2 weeks ago 3 Members · 4 Replies
  • 4 Replies
  • rocuinneagain

    Member
    August 14, 2023 at 12:00 am

    .Q.chk adds missing tables, not missing columns.

    https://code.kx.com/q/ref/dotq/#chk-fill-hdb

     

    Use addcol in kdb/utils/dbmaint.md to add columns.

    Note: this will write to all partitions so ensure you do not overwrite valid data.

     

    https://github.com/KxSystems/kdb/blob/f06c97784b0859517a8461d76607c07a47458ae5/utils/dbmaint.q#L11

    add1col can be used instead to choose which partitions to write to.

  • gyorokpeter-kx

    Member
    August 14, 2023 at 12:00 am

    Do you see the files for the new columns on disk?

    Did you make sure to reload the database with l after the .Q.chk is done?

  • renbright

    Member
    August 14, 2023 at 12:00 am

    Yes, I added new columns yesterday and can see it RDB. Today, I can see new data in yesterday HDB. But can not get HDB back fill using Q chk.

     

    any suggest?

  • renbright

    Member
    August 14, 2023 at 12:00 am

    Thanks for your reply:

    1. I did have new table added at the same time. it seems the new table can be back-filled;

    2. addcol works for that, but each time only add one column. do you know how to add multiple columns one time?

Log in to reply.