Fix ASTERIXDB-1201

The reason the nulls were hitting the bulk loader was because
the filter was always set to null. It seems to work fine when
it is passed in just as it is in IndexInsertDeletePOperator

Change-Id: I0fbfaeb8a98316f4d148285832ad31d991481e4b
Reviewed-on: https://asterix-gerrit.ics.uci.edu/553
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>
Reviewed-by: Taewoo Kim <wangsaeu@gmail.com>
diff --git a/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexBulkloadPOperator.java b/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexBulkloadPOperator.java
index ff23703..15144ab 100644
--- a/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexBulkloadPOperator.java
+++ b/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/operators/physical/IndexBulkloadPOperator.java
@@ -59,7 +59,7 @@
     private final List<LogicalVariable> primaryKeys;
     private final List<LogicalVariable> secondaryKeys;
     private final List<LogicalVariable> additionalFilteringKeys;
-    private final Mutable<ILogicalExpression> filterExpr;
+    private final ILogicalExpression filterExpr;
     private final IDataSourceIndex<?, ?> dataSourceIndex;
 
     public IndexBulkloadPOperator(List<LogicalVariable> primaryKeys, List<LogicalVariable> secondaryKeys,
@@ -68,7 +68,11 @@
         this.primaryKeys = primaryKeys;
         this.secondaryKeys = secondaryKeys;
         this.additionalFilteringKeys = additionalFilteringKeys;
-        this.filterExpr = filterExpr;
+        if (filterExpr != null) {
+            this.filterExpr = filterExpr.getValue();
+        } else {
+            this.filterExpr = null;
+        }
         this.dataSourceIndex = dataSourceIndex;
     }
 
@@ -124,7 +128,7 @@
                 context.getTypeEnvironment(op.getInputs().get(0).getValue()), inputSchemas[0], context);
         Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> runtimeAndConstraints = mp.getIndexInsertRuntime(
                 dataSourceIndex, propagatedSchema, inputSchemas, typeEnv, primaryKeys, secondaryKeys,
-                additionalFilteringKeys, null, inputDesc, context, spec, true);
+                additionalFilteringKeys, filterExpr, inputDesc, context, spec, true);
         builder.contributeHyracksOperator(indexInsertDeleteOp, runtimeAndConstraints.first);
         builder.contributeAlgebricksPartitionConstraint(runtimeAndConstraints.first, runtimeAndConstraints.second);
         ILogicalOperator src = indexInsertDeleteOp.getInputs().get(0).getValue();