Fixed bug with pull-based channel

Change-Id: If758f9e8d5c66c5badd819ad877d269bee4408c8
diff --git a/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/NotifyBrokerRuntime.java b/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/NotifyBrokerRuntime.java
index 8e07af2..9a492d3 100644
--- a/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/NotifyBrokerRuntime.java
+++ b/asterix-bad/src/main/java/org/apache/asterix/bad/runtime/NotifyBrokerRuntime.java
@@ -95,7 +95,14 @@
         eval2 = channelExecutionEvalFactory.createScalarEvaluator(ctx);
         this.entityId = activeJobId;
         this.push = push;
-        recordPrinterFactory = new ARecordPrinterFactory((ARecordType) recordType).createPrinter();
+        if (push) {
+            //for push-based channel, the recordType is the result record type (records are sent directly)
+            recordPrinterFactory = new ARecordPrinterFactory((ARecordType) recordType).createPrinter();
+        } else {
+            //for pull-based channels, the recordType is a list of subscription ids
+            //the subscriptionIdListPrinterFactory is used instead
+            recordPrinterFactory = null;
+        }
         subscriptionIdListPrinterFactory =
                 new AOrderedlistPrinterFactory(new AOrderedListType(BuiltinType.AUUID, null)).createPrinter();
         executionTimeString = null;