InfluxElixir.Client.Local.SQLJoin (InfluxElixir v0.1.40)

Copy Markdown View Source

FROM a CROSS JOIN b for InfluxElixir.Client.Local: every left point paired with every right point, the right side's columns merged in as fields. Rows are the left side's measurement and timestamp.

Qualifiers are dropped at parse time, so a column present on both sides cannot be told apart. The engine refuses an unqualified reference to such a column (the first one its planner meets: WHERE, then the select list, then the rest) and the double does too; a query that names none of them is fine on the engine. When the text did qualify a shared column (a.v) the engine resolves it to a side, which the double cannot, so that is refused by name; so is SELECT *, which would return each shared column twice, which a row map cannot hold. Both sides carry time.

Summary

Types

Fetches a named table or CTE as a source, or the engine's error for it.

What a query reads from: its points and, for a CTE, its columns.

Functions

The query's points after its CROSS JOIN (the source's own when it has none), with the relations they were read from.

Types

fetch_source()

@type fetch_source() :: (binary() -> {:ok, source()} | {:error, term()})

Fetches a named table or CTE as a source, or the engine's error for it.

source()

@type source() :: %{points: [point()], columns: [binary()] | nil, pushdown: boolean()}

What a query reads from: its points and, for a CTE, its columns.

Functions

cross_join(source, query, fetch_source)

The query's points after its CROSS JOIN (the source's own when it has none), with the relations they were read from.