pub fn resolve(statements: Vec<Stmt>) -> Result<Query>
Runs semantic analysis on the query and lowers PL to RQ.