When using the optimizer it rearranges the join order on a cross join that materially impacts the output. Fully reproducible code snippet from sqlglot import diff, parse_one from sqlglot.optimizer ...