parquet_tables_sort Submodule

Turns a parquet_table's key columns into a row permutation, using the library's own Fortran radix engine -- the SAME engine the read-time sort_by= runs on.

That sharing is the whole point of this file. A table can be ordered two ways: by reading a file with parquet_open_reader(..., sort_by=...), or by %sort_by on an already-assembled table. If those two used different comparators they could disagree about null placement, NaN placement or tie order, and nothing would report it -- the rows would simply come back in a different order depending on which path a program happened to take.

The sharing now goes through parquet_sorting's public API rather than the raw C bindings. parquet_column is one of the eleven element types pf_sort_keys%add accepts, so a table's key columns are handed over as ordinary sort keys and pf_argsort does the rest -- which is how the value extraction, the (seconds, nanoseconds) split every timestamp key needs, and the per-row validity handling all came to live in exactly one place. Before parquet_sorting existed this file carried its own copy of all three.

What this file therefore does NOT do: decide anything about order, or know anything about how a value reaches the engine. It resolves key names to columns, refuses the columns that cannot be sort keys, and passes the caller's descending/nulls_first flags through. The refusals stay here rather than being left to pf_argsort's own equivalents, because a table can say which column and which file the problem is in and pf_argsort, handed a bare column, cannot.