[ARQ-1809] Improved metadata handling for sorted and filtered tables.