posthog
posthog copied to clipboard
feat(hogql): add support for using join contraint
Problem
We need support for JOIN USING ... in HogQL.
Changes
This PR adds support for it.
- This is a CH example for a join that is only possible with
USING, but not withON: https://clickhouse.com/docs/en/sql-reference/statements/select/join#:~:text=The%20USING%20clause%20specifies%20one,join%20conditions%20are%20not%20supported. - This is a good spec for
JOIN USING: https://docs.oracle.com/javadb/10.10.1.2/ref/rrefsqljusing.html
Todos
- [ ] Make it work (Current issue is "posthog.hogql.errors.ResolverException: Ambiguous query. Found multiple sources for field: distinct_id")
- [ ] Make the cpp parser work
How did you test this code?
- [ ] test_using -> test_query
- [ ] test_printer
- [ ] test_parser