Move this code to SelectFromClauseVisitor.createTableRef