SELECT (SELECT age FROM users ORDER BY age DESC LIMIT 1) does not sort correctly because ORDER BY on projected columns (non-star selects) is a pre-existing limitation. The sort key cannot be resolved after the PROJECT rewrites columns.
The sort operator evaluates key expressions against the row, but after PROJECT the column ordinals may not match the original table layout.
Fix: ensure sort keys are evaluated before projection, or pass through original column ordinals.
SELECT (SELECT age FROM users ORDER BY age DESC LIMIT 1)does not sort correctly because ORDER BY on projected columns (non-star selects) is a pre-existing limitation. The sort key cannot be resolved after the PROJECT rewrites columns.The sort operator evaluates key expressions against the row, but after PROJECT the column ordinals may not match the original table layout.
Fix: ensure sort keys are evaluated before projection, or pass through original column ordinals.