Array join type (for clickhouse)

38 views
Skip to first unread message

Ruslan Doga

unread,
Feb 11, 2023, 12:16:45 PM2/11/23
to elixir-ecto
šŸ‘‹


Would it be OK to open a PR to either add `:array` join type support into Ecto DSL?

Greg Rychlewski

unread,
Feb 11, 2023, 3:41:03 PM2/11/23
to elixir-ecto
Have you already worked out the PR on your own? If i'm reading the docs correct instead of a table joining a table it's a table joining one of its own columns.Ā 

I'm not sure how much the planner would have to change to support that.

Jon Rowe

unread,
Feb 12, 2023, 11:58:31 AM2/12/23
to elixi...@googlegroups.com
FWIW a table joining one of its own columns is already supported sort of, for example this is a cross join in postgres and is supported:

Ā  Ā from(t in Table, cross_join: e Ā in fragment(ā€œjsonb_array_elements(?)ā€, t.jsonb_array), select: t.id, e.id)

This does seem like something that belongs in an adapter though considering its a non standard SQL extension?
--
You received this message because you are subscribed to the Google Groups "elixir-ecto" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-ecto...@googlegroups.com.

Ruslan Doga

unread,
Feb 12, 2023, 12:06:16 PM2/12/23
to elixir-ecto
Right now there is no way to modify Ecto DSL from the adapter. That is, there is nothing we can do in the adapter to support queries like

Ā  Ā  "events"
Ā  Ā  |> join(:array, [e], ...)

or

Ā  Ā  from e in "events", array_join: ...

as they break before arriving into the adapter.

Also, is LATERAL JOIN an SQL standard? :)
Reply all
Reply to author
Forward
0 new messages