Adding a WITH clause with a simple CTE causes a query with an ORDER BY to fail. This happens even when the CTE is unrelated to the main query.
The following query fails to execute:
Query failed: SqlValidatorException: Table 'x' not found
The following query executes fine: