pub enum QueryBody {
Select(SelectRef),
SetOp {
op: SetOp,
quantifier: Quantifier,
by_name: bool,
left: QueryRef,
right: QueryRef,
},
Values(Slice),
Describe(QueryRef),
}Expand description
What produces the rows of a query.
Variants§
Select(SelectRef)
One SELECT ... FROM ... WHERE ... block.
SetOp
UNION, EXCEPT or INTERSECT over two queries.
Fields
quantifier: QuantifierWhether duplicates survive.
Values(Slice)
VALUES (1, 'a'), (2, 'b'), as a run of Slice in Ast::rows.
A row count and a column count and nothing else, so it is a query body rather than a
statement of its own. That is also what makes INSERT INTO t VALUES (1) and
INSERT INTO t SELECT 1 the same shape by the time anything downstream sees them, which is
the reason the insert walker does not have two arms.
Describe(QueryRef)
DESCRIBE SELECT ..., DESCRIBE t and DESCRIBE 'file.parquet'.
A query body rather than a statement, because that is where the grammar puts it:
SelectStatementType <- ... / DescribeStatement / ..., so FROM (DESCRIBE SELECT 1) is a
subquery over one and needs no rule of its own. The two spellings that name something
instead of writing a query arrive here as DESCRIBE SELECT * FROM that, which is not a
shortcut: on the reference binary DESCRIBE t and DESCRIBE SELECT * FROM t produce the
same six columns and the same rows, down to the primary key and the default.