statement.expand(true) expands tables by their name, not by their alias. Thus joins with aliases do not work as intended.