KX Community

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

Home Forums kdb+ .Q.hdpf throws ` type Error.

  • .Q.hdpf throws ` type Error.

    Posted by k-mambo on November 23, 2021 at 12:00 am

    In the kdb-tick architecture,

    ` Type error occurs when performing the .Q.hdpf function in the RDB process.

    what should I check?

    k-mambo replied 9 months, 1 week ago 2 Members · 3 Replies
  • 3 Replies
  • davidcrossey

    Member
    November 23, 2021 at 12:00 am

    Hi k-mambo,

    A type error is a very general error, meaning it could be any number of issues.

    The best place to start would be to confirm what arguments you are passing to .Q.hdpf and that each of the parameters are of the correct type as per .Q.hdpf

     

    .Q.hdpf[historicalport;directory;partition;`p#field]

     

    Additional resources:

    Thanks for sharing your question on the KX Community!

    Hope this helps,

    David

  • k-mambo

    Member
    November 23, 2021 at 12:00 am

    parameter types being used correctly.

    The details cannot be debugged because the .Q.dpft function is not at a level that can be checked.

    I checked the partition table, some partitions have different column orders.

    In the above case, can a type error occur?

  • davidcrossey

    Member
    November 29, 2021 at 12:00 am

    I’m not certain, but using a simple example, column order in .d file doesn’t appear to impact the operation of .Q.dpft (which is called by .Q.hdpf):

    q)get hsym `$"./2021.11.25/t/.d" 
    `sym`qty`price 
    
    q)get hsym `$"./2021.11.26/t/.d" 
    `sym`price`qty 
    q)\l . 
    q)t 
    date       sym  price   qty 
    ---------------------------- 
    2021.11.25 akjl 90.30751 2 
    2021.11.25 amge 91.49882 33 
    2021.11.26 jobl 64.2737  39 
    2021.11.26 lfjp 38.69818 48

    One can check through the definition of .Q.hdpf to see what it’s doing; granted it’s implemented in k), however you can see some clear parts:

    q).Q.hdpf 
    k){[h;d;p;f](@[`.;;0#]dpft[d;p;f]@)'t@>(#.:)'t:.q.tables`.;if[h:@[hopen;h;0];h"\l .";>h]}

    which as per link in my initial response aligns to this statement of 3 parts:

    “Saves all tables by calling .Q.dpft, clears tables, and sends reload message to HDB.”

    The question to ask yourself is where is it failing?

    If the data is being saved to your HDB then it’s getting past the .Q.dpft call. The type error could be coming from the reload, where you RDB is trying to reload the HDB via handle ‘h’. Are you passing an HDB handle to your process as the first parameter, is that handle valid etc

Log in to reply.