Improved transform() handle a table subquery and add LogicalPlan to represent a query graph.