Class FlipNonReferenceMatchExpression

java.lang.Object
io.deephaven.server.table.ops.filter.AbstractNormalizeFilters
io.deephaven.server.table.ops.filter.FlipNonReferenceMatchExpression
All Implemented Interfaces:
FilterVisitor<Condition>

public class FlipNonReferenceMatchExpression extends AbstractNormalizeFilters
Enforces that all IN-type expressions have a reference on the left side and only literals on the right side. Any non-reference on the left or reference on the right will trigger the entire IN-type expression being replaced with an OR or AND, with a sub-IN for each expression on the right side. Examples: o ColumnA in 1, 2, 3 - left as-is o ColumnA in 1, 2, ColumnB - rewritten as (ColumnA in 1 OR ColumnA in 2 OR ColumnA in ColumnB) o 1 in 3, 4, 5 - will be rewritten as (3 in 1 OR 4 in 1 OR 5 in 1). This is a silly case, but we're not judging. At this step. o 1 in ColumnA, 4, 5 - will be rewritten as (ColumnA in 1 OR 4 in 1 OR 5 in 1) o 1 in ColumnA - will be rewritten as ColumnA in 1 o ColumnA in ColumnB - will be rewritten as ColumnB in ColumnA. Note that like the second example, this isn't productive on its own, but as a pair with a reference on the right, it will be noticed by ConvertInvalidInExpressions. It is assumed that some time after this step, related "in" expressions will be merged together, and that these one-off expressions will get checked later.