PQL Read operations
Read operations can be grouped into several types.
Row calls return an object representing a set of column keys, contained in a single row. Row calls may be used as input arguments to other queries.
- ConstRow() provides a “literal” bitmap value -* i.e. it returns the record IDs or record keys specified by the user.
- Row() selects from a single set row, by row key -* i.e. it returns the record IDs or record keys that have a specified value in a specified field.
- Limit() is also a row call by return type. It wraps other row calls to select a subset of results, in a pagination sense.
- Difference() computes the set difference between its first argument and all subsequent arguments (all row calls).
- Intersect() computes the set intersection across its two or more row call arguments.
- Not() computes the complement of the single row call argument, relative to the universal set for the index -* i.e. it returns the difference between
All()and some other row call.
- Union() computes the set union across its one or more row call arguments.
- UnionRows() computes the set union across many rows. Rather than accepting several row call arguments,
UnionRows()accepts any number of
- Xor() computes the exclusive set difference between its first argument and all subsequent arguments (all row calls.
Distinct is a special row-like call, in that it can be used in the same context that other row calls can be used, despite a slight variation in its output type.
Rows calls return an object representing a set of row keys, contained in a single column. Rows calls may be used as input arguments to other queries.
- Rows returns a list of row IDs in the given field which have at least one bit set -* i.e. it returns a list of value in a field for all values associated with a record.
Membership calls return a boolean value indicating set membership.
Membership calls include:
- IncludesColumn indicates whether a given record ID or record key is present in a given row call.
Count calls return counts of the number of elements in groups of sets. Count calls are often the top-level call in a query.
Count calls include:
- Count computes the scalar count of elements contained in its single row call argument.
- GroupBy computes counts of the intersection of every combination of its rows call arguments. GroupBy provides much of the basic grouping functionality that is available in a relational database.
- TopK computes the count of the top
Krows in a field, with fewer caveats.
- TopN computes the count of the top
Nrows in a field, with some caveats.
Aggregation calls perform other aggregation operations on individual sets.
- Max computes the maximum integer value or timestamp value in a field, from a single row call argument.
- Min computes the minimum integer value or timestamp value in a field, from a single row call argument.
- Percentile computes the percentile of integer values in a field, from a single row call argument.
- Sum computes the sum of integer values in a field, from a single row call argument.
Exploratory calls are used to drill down into a data set.
- Extract is analogous to a general
selectquery in a relational database, returning a subset of both rows and columns.
- Apply executes Ivy code against data stored using the
float64and / or
- Arrow is analogous to
SELECT <columns> FROM <table> WHERE <condition>query in SQL. Executes on data stored using the
float64and / or