Given a child and a grandchild that are present beneath a sort operator, try to resolve the sort ordering and returns it with a list of attributes that are missing from the child but are present in the grandchild.
Name for this rule, automatically inferred based on class name.
Name for this rule, automatically inferred based on class name.
In many dialects of SQL it is valid to sort by attributes that are not present in the SELECT clause. This rule detects such queries and adds the required attributes to the original projection, so that they will be available during sorting. Another projection is added to remove these attributes after sorting.