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

Two joins in a row fail #56

Open
Liudvikas-vinted opened this issue Jul 17, 2023 · 0 comments
Open

Two joins in a row fail #56

Liudvikas-vinted opened this issue Jul 17, 2023 · 0 comments

Comments

@Liudvikas-vinted
Copy link

To reproduce:

TABLE <- tbl(impala, "default.test")

## The following works
TABLE %>%
  left_join(TABLE) 

## The following chokes the Impala engine 
TABLE %>%
  left_join(TABLE) %>%
  left_join(TABLE) 

## Because
TABLE %>%
  left_join(TABLE) %>%
  left_join(TABLE) %>%
  show_query()

> <SQL>
> SELECT `default`.`test`.``.``.`1`.*
> FROM `default`.`test` AS `default`.`test`.``.``.`1`
> LEFT JOIN `default`.`test` AS `default`.`test`.``.``.`2`
>   ON (
>     `default`.`test`.``.``.`1`.`x` = `default`.`test`.``.``.`2`.`x` AND
>     `default`.`test`.``.``.`1`.`y` = `default`.`test`.``.``.`2`.`y`
>   )
> LEFT JOIN `default`.`test` AS `default`.`test`.``.``.`3`
>  ON (
>     `default`.`test`.``.``.`1`.`x` = `default`.`test`.``.``.`3`.`x` AND
>     `default`.`test`.``.``.`1`.`y` = `default`.`test`.``.``.`3`.`y`
>   )

Notice how generated query contains empty identifiers in backticks. Buggy behaviou doesn't happen when TABLE is backed by SQLite, for example, so this is likely specific to implyr.

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.2 LTS

dbplyr_2.3.2
implyr_0.4.0

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

1 participant