private void insertFilterOnTop(
      TableScanOperator tableScanOp,
      ExprNodeDesc filterExpr) {

      // Get the top operator and it's child, all operators have a single parent
      Operator<? extends OperatorDesc> currChild = tableScanOp.getChildOperators().get(0);

      // Create the filter Operator and update the parents and children appropriately
      tableScanOp.setChildOperators(null);
      currChild.setParentOperators(null);

      Operator<FilterDesc> filter = OperatorFactory.getAndMakeChild(
        new FilterDesc(filterExpr, false),
        new RowSchema(tableScanOp.getSchema().getSignature()), tableScanOp);
      OperatorFactory.makeChild(filter, currChild);
    }
Inserts a filter below the table scan operator. Construct the filter
from the filter expression provided.
@param tableScanOp the table scan operators
@param filterExpr the filter expression
ql/src/java/org/apache/hadoop/hive/ql/optimizer/SkewJoinOptimizer.java