Flattens a parsed WHERE into its conjuncts, pushing a NOT in as the
engine's optimizer does, for the modules that reason about what a filter
leaves (InfluxElixir.Client.Local.SQLBounds for a numeric column,
InfluxElixir.Client.Local.SQLRange for time).
The structure is the same for both and the leaves differ, so the caller
gives flatten/3 what to put for each kind of leaf:
:never— a constant false ({:or, []}, or the negation of an empty conjunction):opaque— a function from what hides its conjuncts (anOR, the negation of several conjuncts) to the leaf for it:clause— a function from a predicate and whether aNOTis pushed into it to the leaves it contributes
Summary
Functions
The leaves of a conjunction. negated says that a NOT has been pushed in
front of it.
Whether the operator has a negation.
The operator that holds when the predicate is negated, or the operator itself when it has no negation here.
Types
Functions
@spec flatten([InfluxElixir.Client.Local.SQLParser.where_node()], boolean(), leaves()) :: [term()]
The leaves of a conjunction. negated says that a NOT has been pushed in
front of it.
Whether the operator has a negation.
The operator that holds when the predicate is negated, or the operator itself when it has no negation here.