Operators for Ordered Tables

[This is preliminary documentation and subject to change.]

DBOP_top, DBOP_top_percent, DBOP_top_plus_ties, DBOP_top_percent_plus_ties
Take the first rows from an ordered table. The operators are different from the sampling operators because they prohibit randomness. The "top" operations require a fixed count of rows. The "top_percent" operations require a fraction of the input rows (not an approximation). The "plus ties" operators include all rows that are equal (with respect to the input table's sort order) to the last one explicitly requested. The first required input to all operators is an ordered table. The top, and top_plus_ties operators stored the count of rows as a positive integer in the ulValue field of the command node. The top_percent* operators take a second required scalar_list_anchor input. The elements of that list contain two scalar_constant members representing a pair of positive integers expressing a fraction between 0 and 1. The output is an ordered table.
DBOP_rank, DBOP_rank_ties_equally, DBOP_rank_ties_equally_and_skip
Add a new column "rank" to the table, counting from 1 to the table's cardinality. If the column name "rank" already exists, "rank2" ("rank3" etc.) is added instead. The "ties" operations assign the same rank to items that are equal (with respect to the input table's sort order). The "and skip" variant skips an appropriate number of values in the counting sequence. Examples: without skipping — 1, 2, 2, 2, 3, 4, 4, 5; with skipping — 1, 2, 2, 2, 5, 6, 6, 8. The input is an ordered table. If the operator is "rank," the output is an ordered unique table; for the "ties" operators, it is an ordered table.