KX Community

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

Home Forums kdb+ Natural Query Interface API fails to aggregate rdb + hdb results

  • Natural Query Interface API fails to aggregate rdb + hdb results

    Posted by user931206 on April 16, 2024 at 8:55 am

    We have been using Natural Query Interface API quite a lot in our plant.
    Users like the flexibility and we like the control we have over what they are doing in our HAPI client.
    However, there is an issue we have with it.

    Link: https://code.kx.com/q/wp/query-interface/

    Queries like:

    H) select last publishTime from tableName where date within(.z.D-5;.z.D)

    Return something like :

    publishTime
    ---------------------
    2024.01.14D23:59:59
    2024.01.15D16:00:00

    Query is executed once on the rdb and once on the hdb.
    I have tried fixing this in the past, but my fix was also preventing any other duplicates (real duplicates that we were interested in).

    Has anyone fixed this issue? If yes, what are your suggestions?

    Thank you

    • This discussion was modified 1 month, 1 week ago by  user931206.
    user931206 replied 1 month, 1 week ago 2 Members · 2 Replies
  • 2 Replies
  • rocuinneagain

    Member
    April 16, 2024 at 9:21 am

    What is Holistic API? You may be using an internal tool which we can not answer questions on.

    Standard kdb will not behave as you have outlined:

    q)`:testHDB/2024.04.16/tableName/ set ([] publishTime:asc 100?.z.t;otherCol:100?100.0)


    `:testHDB/2024.04.16/tableName/
    q)`:testHDB/2024.04.15/tableName/ set ([] publishTime:asc 100?.z.t;otherCol:100?100.0)


    `:testHDB/2024.04.15/tableName/
    q)\l testHDB
    q)select last publishTime from tableName where date within(.z.D-5;.z.D)
    publishTime
    ------------
    09:12:36.839

Log in to reply.