Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for JOINs #262

Open
alexguanga opened this issue Sep 11, 2020 · 1 comment
Open

Support for JOINs #262

alexguanga opened this issue Sep 11, 2020 · 1 comment

Comments

@alexguanga
Copy link

Hi all,

We are trying to extract JOINS from the queries (or even the query itself would be helpful).

We are using https://github.com/gabfl/bigquery_fdw, which is built on top of https://github.com/Segfault-Inc/Multicorn. Now, if we try to PG join like SELECT col_a FROM foreign_table_a LEFT JOIN foreign_table_b USING (primary_key), the translation in BigQuery is SELECT col_a FROM foreign_table_a. This makes complete sense based on the bigquery_fdw's query builder.

However, is there any way to extract the foreign table I want to join?

@alexguanga alexguanga changed the title JOINs Support for JOINs Sep 11, 2020
@snth
Copy link

snth commented Sep 29, 2020

I'm not sure whether this is exactly the same but I think my issue is related. I have the following stylized example:

WITH config(param) AS (
    VALUES
        ('A')
--        , ('B')
)
SELECT
    *
FROM config AS cfg
LEFT JOIN LATERAL my_fdw AS fdw
    ON fdw.param = cfg.param
;

The code above works fine and my multicorn object receives Qual('param', '=', 'A') as a parameter. However when I enable the commented out line for ('B') then the quals received by my multicorn object are an empty list quals == [].

I thought that perhaps with a simple LEFT JOIN postgres only does the filtering at the end but I had hoped that with the LATERAL join multicorn would receive each qual in turn.

Any ideas on how I could achieve the desired behaviour? Basically I would like my multicorn API calls to loop over a set of configured values in some other table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants