KX Community

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

Home Forums KX Solutions How to write data into table from python to kdb+ on Refinery?

  • How to write data into table from python to kdb+ on Refinery?

    Posted by kovacsi on March 16, 2022 at 12:00 am

    Hi

    I need to write data in to a table using python.

    I used UDF before, but cant make it work now?

     

    how to do it?

    Thanks

    Ori

    kovacsi replied 8 months ago 3 Members · 4 Replies
  • 4 Replies
  • davidcrossey

    Member
    March 18, 2022 at 12:00 am

    Hi Ori,
    Please find some reference information here for writing a Python UDF for Refinery: Realtime UDF (kx.com).

    Kind regards,

    David

  • kovacsi

    Member
    March 20, 2022 at 12:00 am

    Thanks David

    I have to understand how to  make it active on background every 300 milliseconds.

    my inquiry is more for integrating python udf as a call-back / event handler to timer tick.

    Actually I have to connect a consistent data source to kdb+ , using python. I have

    python programs to get data from data sources but don’t know how to:

    1. use an event handler to accept the data and push it to a kdb+ refinery data base.

    2. setup multiple sources to update the same data base and write it to HDB at end of day.

     

    do you know how to do it?

    Thanks

    Ori

  • davidcrossey

    Member
    March 21, 2022 at 12:00 am

    Hi Ori,

    I’m not too familiar with this use case, however I hope someone in the Community will be able to give some advice Best regards,
    David

  • eohara

    Member
    March 23, 2022 at 12:00 am

    Hi Ori,

    In my experience UDFs are used for reads, not writes. Your problem sounds more suited to PyKX. With that you can convert your python data into kdb+, and publish to the Refinery TP (see Refinery architecture diagram Architecture (kx.com), your python process(es) act as feedhandlers).

    Thanks,

    Eoghan

Log in to reply.