OHDSI / WebAPI

OHDSI WebAPI contains all OHDSI services that can be called from OHDSI applications
Apache License 2.0
126 stars 156 forks source link

ddl/achilles endpoint is missing the tempSchema parameter #2351

Open katy-sadowski opened 4 months ago

katy-sadowski commented 4 months ago

Expected behavior

Similar to the ddl/results endpoint, it is possible to pass a tempSchema parameter to this endpoint, for databases which require a temp schema to be specified.

Actual behavior

It does not have this parameter:

Screenshot 2024-02-20 111506

Steps to reproduce behavior

Generate and run the ddl/achilles queries on a database which requires specification of a temp schema (this is the case for our Snowflake instance). An error will be raised for the DROP IF EXISTS clauses for the temp tables due to their lack of a schema. However, we're unable to pass in a temp schema parameter to prevent this issue from happening.

We worked around it by pulling down the raw untranslated queries, then translating with SqlRender / tempEmulationSchema. These queries ran without error.

chrisknoll commented 4 months ago

Ok, we should fix, but will need to understand the necessary change: I think we run sqlRender() when we are passed in a dialect to the endpoint, so I think the change is the endpint needs to accept that param so that it's passed into sqlRender...does that sound like the necessary change?

katy-sadowski commented 4 months ago

Yeah, I think it should work just like ddl/results: https://github.com/OHDSI/WebAPI/blob/f258186ce9955ff5ee1cef220de88da7a9049de2/src/main/java/org/ohdsi/webapi/service/DDLService.java#L132-L154

One note (out of scope) - oracleTempSchema is actually deprecated, in favor of tempEmulationSchema. But it still works.