package edu.washington.escience.myria.operator;

import edu.washington.escience.myria.Schema;
import edu.washington.escience.myria.TupleBatch;

/**
 * Implementation of set difference. Duplicates are not preserved.
 * 
 * @author whitaker
 */
public class Difference extends BinaryOperator {

  /**
   * Instantiate a set difference operator.
   * 
   * @param left the operator being subtracted from.
   * @param right the operator to be subtracted.
   */
  public Difference(final Operator left, final Operator right) {
    super(left, right);
  }

  /** Required for Java serialization. */
  private static final long serialVersionUID = 1L;

  @Override
  protected TupleBatch fetchNextReady() throws Exception {
    // TODO Auto-generated method stub
    return null;
  }

  @Override
  protected Schema generateSchema() {
    return getLeft().getSchema();
  }
}

@@ -42,16 +42,114 @@
 rator;%0A%0A
+import com.google.common.collect.ImmutableMap;%0A%0Aimport edu.washington.escience.myria.DbException;%0A
 import e
@@ -742,221 +742,1050 @@
 %0A%0A  
-@Override%0A  protected TupleBatch fetchNextReady() throws Exception %7B%0A    // TODO Auto-generated method stub%0A    return null;%0A  %7D%0A%0A  @Override%0A  protected Schema generateSchema() %7B%0A    return getLeft().getSchema();
+private TupleBatch processLeftChildTB(TupleBatch leftTB) %7B%0A    // TODO Auto-generated method stub%0A    return null;%0A  %7D%0A%0A  private void processRightChildTB(TupleBatch rightTB) %7B%0A%0A  %7D%0A%0A  @Override%0A  protected TupleBatch fetchNextReady() throws Exception %7B%0A    final Operator right = getRight();%0A%0A    /* Drain the right child. */%0A    while (!right.eos()) %7B%0A      TupleBatch rightTB = right.nextReady();%0A      if (rightTB == null) %7B%0A        if (right.eos()) %7B%0A          break;%0A        %7D%0A        return null;%0A      %7D%0A      processRightChildTB(rightTB);%0A    %7D%0A%0A    final Operator left = getLeft();%0A    while (!left.eos()) %7B%0A      TupleBatch leftTB = left.nextReady();%0A      if (leftTB == null) %7B%0A        return null;%0A      %7D%0A      return processLeftChildTB(leftTB);%0A    %7D%0A%0A    return null;%0A  %7D%0A%0A  @Override%0A  protected Schema generateSchema() %7B%0A    return getLeft().getSchema();%0A  %7D%0A%0A  @Override%0A  public void init(final ImmutableMap%3CString, Object%3E execEnvVars) throws DbException %7B%0A  %7D%0A%0A  @Override%0A  protected void cleanup() throws DbException %7B
 %0A  %7D

Add some basic scaffolding for scanning input relations