The schema errors of a SQL query for InfluxElixir.Client.Local: a column
the query names that no row has — in SELECT, an aggregate, WHERE,
GROUP BY, ORDER BY or DISTINCT — is the engine's schema error ("No
field named prod. Valid fields are ..."), not an empty or unsorted result.
The usual cause is a typo or a forgotten pair of quotes around a string
literal. With no rows the schema is unknown, so nothing is checked.
A relation is one table or CTE of a FROM, with the name its columns are
qualified by in the engine's "Valid fields" list.
Summary
Types
The clause a reference stands in.
A stored point, as InfluxElixir.Client.Local keeps it.
One relation of a FROM: the name its columns are qualified with, its
points, and its columns in order when it is a CTE (a table's are its
points', sorted).
Functions
:ok, or the engine's schema error for the first column the query names that is not there.
Every source column the query refers to, with the clause it stands in, in the order the engine resolves the clauses. ORDER BY may name an output alias instead, which is not a source column.
The columns an expression, or a plan item over expressions, reads.
The columns a query's rows are made of, whether or not any row has a value
for them: a column that is null in every row is still in the schema the
next query reads. nil when a relation's columns are not known.
Every tag and field name any of the points has.
A source (its points and, for a CTE, its columns) as the relation known by qualifier.
The query with the positions in a SELECT *'s ORDER BY replaced by the
columns they name, or the engine's planning error for a position outside
them (ORDER BY 0 and a position past the last column; verified).
Whether the query selects *.
Whether a relation's columns cannot be known: a table with no rows.
The columns a WHERE reads.
Types
@type clause() :: :where | :select | :order | :group | :on
The clause a reference stands in.
@type point() :: InfluxElixir.Client.Local.LineProtocolParser.point()
A stored point, as InfluxElixir.Client.Local keeps it.
One relation of a FROM: the name its columns are qualified with, its
points, and its columns in order when it is a CTE (a table's are its
points', sorted).
Functions
@spec check([relation()], InfluxElixir.Client.Local.SQLParser.parsed_query()) :: :ok | {:error, term()}
:ok, or the engine's schema error for the first column the query names that is not there.
@spec clause_refs(InfluxElixir.Client.Local.SQLParser.parsed_query()) :: [ {clause(), InfluxElixir.Client.Local.SQLExpr.column_ref()} ]
Every source column the query refers to, with the clause it stands in, in the order the engine resolves the clauses. ORDER BY may name an output alias instead, which is not a source column.
@spec expr_fields(term()) :: [InfluxElixir.Client.Local.SQLExpr.column_ref()]
The columns an expression, or a plan item over expressions, reads.
@spec output_columns(InfluxElixir.Client.Local.SQLParser.parsed_query(), [relation()]) :: [binary()] | nil
The columns a query's rows are made of, whether or not any row has a value
for them: a column that is null in every row is still in the schema the
next query reads. nil when a relation's columns are not known.
Every tag and field name any of the points has.
A source (its points and, for a CTE, its columns) as the relation known by qualifier.
@spec resolve_ordinals(InfluxElixir.Client.Local.SQLParser.parsed_query(), [ relation() ]) :: {:ok, InfluxElixir.Client.Local.SQLParser.parsed_query()} | {:error, map()}
The query with the positions in a SELECT *'s ORDER BY replaced by the
columns they name, or the engine's planning error for a position outside
them (ORDER BY 0 and a position past the last column; verified).
@spec star?(InfluxElixir.Client.Local.SQLParser.parsed_query()) :: boolean()
Whether the query selects *.
Whether a relation's columns cannot be known: a table with no rows.
@spec where_refs([InfluxElixir.Client.Local.SQLParser.where_node()]) :: [ InfluxElixir.Client.Local.SQLExpr.column_ref() ]
The columns a WHERE reads.