String alias ) {
return new Column(new SelectorName(table), columnName, alias);
}
protected PlanNode optimize( String sql ) {
QueryCommand query = new BasicSqlQueryParser().parseQuery(sql, context.getTypeSystem());
Problems problems = context.getProblems();
assertThat("Problems parsing query: " + sql + "\n" + problems, problems.hasErrors(), is(false));
PlanNode plan = new CanonicalPlanner().createPlan(context, query);
assertThat("Problems planning query: " + sql + "\n" + problems, problems.hasErrors(), is(false));
PlanNode optimized = new RuleBasedOptimizer().optimize(context, plan);