API Call and SQL Query

StephenPegg
StephenPegg Registered Posts: 3 ✭✭✭✭

Hi,

I have a scenario where I am trying to use an enrichment dataset on an endpoint. My endpoint is a model that returns a ML prediction. For the model to be called, I first need to enrich my data.

My enrichment dataset is a SQL query which takes in a single id in the where clause and returns lots of other data.

At the moment, I have a global variable that I use to pass the single id into my SQL query and it works fine.

What I am trying to do is use the id that is passed on my API call to filter my SQL query. Is this possible?

e.g. API call with id 1234, enrichment SQL query contains clause where id = 1234, my data gets returned which is subsequently passed to a ML model which returns a prediction.

Does anybody have any ideas?

Thanks

Best Answer

Answers

  • Manuel
    Manuel Alpha Tester, Dataiker Alumni, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Core Concepts, Dataiku DSS Adv Designer, Registered Posts: 193 ✭✭✭✭✭✭✭

    Hi,

    Does this page answer your question? https://doc.dataiku.com/dss/latest/apinode/endpoint-sql-query.html

    I hope this helps.

  • StephenPegg
    StephenPegg Registered Posts: 3 ✭✭✭✭

    Manual,

    Thanks for this and I did see this one. I need to modify my original message to mentioned that once the data is returned by the endpoint enrichment, a model is called and a prediction returned.

    The endpoint is not returning the results of the SQL query. I'll amend my original message now.

  • StephenPegg
    StephenPegg Registered Posts: 3 ✭✭✭✭

    @Manuel
    this was exactly what I was looking for and I have managed to successful create a single coordinator endpoint that calls two others.

    The first is a SQL query which returns the features required to run a model

    The second is a predictive model which takes the input from the first endpoint.

    Thanks for the help. I hope this also helps others.

Setup Info
    Tags
      Help me…