nineinchnick / trino-openapi

Trino connectors for accessing APIs with an OpenAPI spec
Apache License 2.0
22 stars 3 forks source link

Support joins between tables with required predicates (dynamic filtering) #89

Open mmadson opened 2 months ago

mmadson commented 2 months ago

I'm getting errors when I try to join 2 rest api get request / responses on some common property.

For example:

SELECT
  *
FROM
  "openapi"."default"."get_api_foo" as F
WHERE
  F."some_json_prop" IN (
    SELECT
      B."some_json_prop"
    FROM
      "openapi"."default"."get_api_bar" as B
    WHERE
      B."some_json_prop" IS NOT NULL
    LIMIT
      5
  )

Seems to always give me an invalid response code for getRows. Feels like it's trying to construct an invalid request but not entirely sure. Just wondering if this kind of usage should work or if I'm barking up the wrong tree.

nineinchnick commented 2 months ago

What error are you getting?

jmbergamini commented 2 months ago

The error message states, "Missing required constraint for "join field name""

nineinchnick commented 2 months ago

Ah yes, this is expected because the connector doesn't implement dynamic filtering. It also currently only supports single values in predicates. I'll eventually implement this, but can give any estimates when.