KX Community

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

Home Forums kdb+ .z.pd function throwing error for non unique handles

Tagged: 

  • .z.pd function throwing error for non unique handles

    Posted by user931206 on June 5, 2024 at 2:43 pm

    can someone help with the following error:

    2024.06.05D00:02:14.371532071 | serverName | wdb | procname_wdb | ERR | runHooks | Failed to run hook(“.eod.namespace1.functionname[tab1;tab2]”;”.z.pd – expected unique vector of int handles”)

    This process is started with ” -s -2 “

    the .z.pd function is defined like:

    .z.pd:{$[.z.K<3.3;

    u#int$();

    u#exec w from .servers.getservers[proctype;sortworkertypes;()!();1b;0b]]

    }

    .z.pd is ->

    u

    int$()

    The above is in one of the colums in a table

    time query

    -------------------------------------------------

    2009.08.05D09:25:53.693765248 "function1[params]"

    2012.08.18D19:47:01.117332288 "function2[params]"

    and I run it as {@[value;xquery;{.log.error[name;”Message”]}]}each table

    All the queries ran like this fail.
    Important to mention that even though the process has ” -s -2″ the are not processes started as slaves.
    However, the rest of the code works fine. It’s just this bit that fails.

    sorry about the formatting. it just doesn’t work

    user931206 replied 5 months, 2 weeks ago 3 Members · 3 Replies
  • 3 Replies
  • megan_mcp

    Administrator
    June 11, 2024 at 11:08 am

    Hi @user931206

    Is it possible you could send a screenshot of the code rather than pasting it in the editor?

    Apologies as this is a problem on our end, not yours.

    Thanks,

    Megan

    • user931206

      Member
      July 10, 2024 at 10:42 am

      Hey

      it would work in this instance, but there have been situations when I needed to give people the code to create a table for testing and a screenshot of the code wouldn’t help anyone.

  • sujoy

    Member
    June 16, 2024 at 3:26 am

    Your function is using peach and setting -s -2, it is expecting handles on .z.pd, which is blank and hence failing.

    Start your process

    q -s 2

    q).z.pd:u#int$()

    q).z.pd

    u#int$()

    q){x+til 2} peach til 2

    0 1

    1 2

    q)\s -2

    q){x+til 2} peach til 2

    '.z.pd - expected unique vector of int handles

    [0] {x+til 10} peach til 10

    ^

    q))

Log in to reply.