Class GroupByNode.ExpressionSorter
java.lang.Object
org.apache.derby.impl.sql.compile.GroupByNode.ExpressionSorter
- All Implemented Interfaces:
Comparator<SubstituteExpressionVisitor>
- Enclosing class:
GroupByNode
private static class GroupByNode.ExpressionSorter
extends Object
implements Comparator<SubstituteExpressionVisitor>
Comparator class for GROUP BY expression substitution.
This class enables the sorting of a collection of
SubstituteExpressionVisitor instances. We sort the visitors
during the tree manipulation processing in order to process
expressions of higher complexity prior to expressions of
lower complexity. Processing the expressions in this order ensures
that we choose the best match for an expression, and thus avoids
problems where we substitute a sub-expression instead of the
full expression. For example, if the statement is:
... GROUP BY a+b, a, a*(a+b), a+b+c
we'll process those expressions in the order: a*(a+b),
a+b+c, a+b, then a.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
ExpressionSorter
private ExpressionSorter()
-
-
Method Details
-
compare
- Specified by:
compare
in interfaceComparator<SubstituteExpressionVisitor>
-