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

test/enhance join support #14

Closed
inkrement opened this issue May 6, 2017 · 2 comments
Closed

test/enhance join support #14

inkrement opened this issue May 6, 2017 · 2 comments

Comments

@inkrement
Copy link
Member

dplyr and clickhouse support joins, but click house does not use the standard SQL syntax. Therefore, it might be the case, that we have to fix this.

@inkrement
Copy link
Member Author

inkrement commented May 13, 2017

Clickhouse Join syntax: [GLOBAL] ANY|ALL INNER|LEFT [OUTER] JOIN (subquery)|table USING columns_list.

SQL Join syntax: [[FULL|LEFT|RIGHT [OUTER]]|INNER] JOIN (subquery)|table ON columns_list |USING columns_list

  • Clickhouse supports special ANY/ALL settings - would be nice if we allow the user to use this by adding a new parameter to the method's signature.
  • write tests
  • rewrite select part. seems like clickhouse does not support table aliases (but subquery aliases). sql_join.ClickhouseConnection should not add aliases for the first table (LEFT_TABLE). So we have to rewrite it that dplyr generates two subqueries and then add aliases (How to get join columns? ClickHouse/ClickHouse#528)
  • click house does not support ON syntax, but dplyr: SQL joins always use the ON ... syntax, avoiding USING ... even for natural joins. Improved handling of tables with columns of the same name (#1997, @javierluraschi). They now generate SQL more similar to what you'd write by hand, eliminating a layer or two of subqueries (#2333)
  • Using ALL corresponds to the normal JOIN semantic from standard SQL: add all keyword to all joins per default

@inkrement
Copy link
Member Author

RIGHT and FULL joins are actually supported. But RIGHT join is not equivalent to the flipped LEFT join - you still want your "right" table to be small to fit in memory. Also, there is a bug in the implementation that is fixed in master, but not yet released.

inkrement added a commit that referenced this issue May 17, 2017
inkrement pushed a commit that referenced this issue Dec 4, 2019
inkrement pushed a commit that referenced this issue Dec 4, 2019
inkrement pushed a commit that referenced this issue Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant