Applies the upstream optimizer rule set (predicate pushdown, join reordering, CTE and subquery elimination, expression simplification, etc.) and returns the rewritten SQL.
Arguments
- sql
A single character string with one or more SQL statements (separated by
;).- dialect
Dialect used for parsing.
- schema
Optional schema specification (see
as_polyglot_schema()); improves resolution of unqualified or ambiguous columns.