diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
index 470201d..9879a2d 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/aqlj/server/APIClientThread.java
@@ -220,8 +220,7 @@
             AQLParser parser = new AQLParser(new StringReader(stmt));
             List<Statement> statements = parser.Statement();
             SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, true,
-                    false, false, false, false, false, false);
-            pc.setGenerateJobSpec(true);
+                    false, false, false, false, false, true, false);
 
             MetadataManager.INSTANCE.init();
             if (statements != null && statements.size() > 0) {
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
index 95ec76c..1aad2ec 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/APIFramework.java
@@ -298,6 +298,10 @@
             }
         }
 
+        if (!pc.isGenerateJobSpec()) {
+            return null;
+        }
+        
         AlgebricksPartitionConstraint clusterLocs = queryMetadataProvider.getClusterLocations();
         builder.setBinaryBooleanInspectorFactory(format.getBinaryBooleanInspectorFactory());
         builder.setBinaryIntegerInspectorFactory(format.getBinaryIntegerInspectorFactory());
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
index 8050a3f..4ae6edd 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/common/SessionConfig.java
@@ -1,100 +1,62 @@
-/**
- * 
- */
 package edu.uci.ics.asterix.api.common;
 
 public class SessionConfig {
-    private int port;
-    private boolean printExprParam;
-    private boolean printRewrittenExprParam;
-    private boolean printLogicalPlanParam;
-    private boolean printOptimizedLogicalPlanParam;
-    private boolean printPhysicalOpsOnly;
-    private boolean printJob;
-    private boolean optimize;
-    private boolean generateJobSpec = true;
+    private final int port;
+    private final boolean optimize;
+    private final boolean printExprParam;
+    private final boolean printRewrittenExprParam;
+    private final boolean printLogicalPlanParam;
+    private final boolean printOptimizedLogicalPlanParam;
+    private final boolean printPhysicalOpsOnly;
+    private final boolean generateJobSpec;
+    private final boolean printJob;
 
     public SessionConfig(int port, boolean optimize, boolean printExprParam, boolean printRewrittenExprParam,
             boolean printLogicalPlanParam, boolean printOptimizedLogicalPlanParam, boolean printPhysicalOpsOnly,
-            boolean printJob) {
-        this.setPort(port);
-        this.setOptimize(optimize);
-        this.setPrintExprParam(printExprParam);
-        this.setPrintRewrittenExprParam(printRewrittenExprParam);
-        this.setPrintLogicalPlanParam(printLogicalPlanParam);
-        this.setPrintOptimizedLogicalPlanParam(printOptimizedLogicalPlanParam);
-        this.setPrintPhysicalOpsOnly(printPhysicalOpsOnly);
-        this.setPrintJob(printJob);
-    }
-
-    public void setPort(int port) {
+            boolean generateJobSpec, boolean printJob) {
         this.port = port;
+        this.optimize = optimize;
+        this.printExprParam = printExprParam;
+        this.printRewrittenExprParam = printRewrittenExprParam;
+        this.printLogicalPlanParam = printLogicalPlanParam;
+        this.printOptimizedLogicalPlanParam = printOptimizedLogicalPlanParam;
+        this.printPhysicalOpsOnly = printPhysicalOpsOnly;
+        this.generateJobSpec = generateJobSpec;
+        this.printJob = printJob;
     }
 
     public int getPort() {
         return port;
     }
 
-    public void setPrintExprParam(boolean printExprParam) {
-        this.printExprParam = printExprParam;
-    }
-
     public boolean isPrintExprParam() {
         return printExprParam;
     }
 
-    public void setPrintRewrittenExprParam(boolean printRewrittenExprParam) {
-        this.printRewrittenExprParam = printRewrittenExprParam;
-    }
-
     public boolean isPrintRewrittenExprParam() {
         return printRewrittenExprParam;
     }
 
-    public void setPrintLogicalPlanParam(boolean printLogicalPlanParam) {
-        this.printLogicalPlanParam = printLogicalPlanParam;
-    }
-
     public boolean isPrintLogicalPlanParam() {
         return printLogicalPlanParam;
     }
 
-    public void setPrintOptimizedLogicalPlanParam(boolean printOptimizedLogicalPlanParam) {
-        this.printOptimizedLogicalPlanParam = printOptimizedLogicalPlanParam;
-    }
-
     public boolean isPrintOptimizedLogicalPlanParam() {
         return printOptimizedLogicalPlanParam;
     }
 
-    public void setPrintJob(boolean printJob) {
-        this.printJob = printJob;
-    }
-
     public boolean isPrintJob() {
         return printJob;
     }
 
-    public void setPrintPhysicalOpsOnly(boolean prinPhysicalOpsOnly) {
-        this.printPhysicalOpsOnly = prinPhysicalOpsOnly;
-    }
-
     public boolean isPrintPhysicalOpsOnly() {
         return printPhysicalOpsOnly;
     }
 
-    public void setOptimize(boolean optimize) {
-        this.optimize = optimize;
-    }
-
     public boolean isOptimize() {
         return optimize;
     }
 
-    public void setGenerateJobSpec(boolean generateJobSpec) {
-        this.generateJobSpec = generateJobSpec;
-    }
-
     public boolean isGenerateJobSpec() {
         return generateJobSpec;
     }
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
index 436673b..034e1f4 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/APIServlet.java
@@ -58,8 +58,7 @@
             List<Statement> aqlStatements = parser.Statement();
             SessionConfig sessionConfig = new SessionConfig(port, true, isSet(printExprParam),
                     isSet(printRewrittenExprParam), isSet(printLogicalPlanParam),
-                    isSet(printOptimizedLogicalPlanParam), false, isSet(printJob));
-            sessionConfig.setGenerateJobSpec(true);
+                    isSet(printOptimizedLogicalPlanParam), false, true, isSet(printJob));
             MetadataManager.INSTANCE.init();
             AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, out, sessionConfig, DisplayFormat.HTML);
             List<QueryResult> executionResults = null;
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
index f007cbb..7e72d94 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/java/AsterixJavaClient.java
@@ -64,8 +64,8 @@
         MetadataManager.INSTANCE.init();
 
         SessionConfig pc = new SessionConfig(AsterixHyracksIntegrationUtil.DEFAULT_HYRACKS_CC_CLIENT_PORT, optimize,
-                false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly, printJob);
-        pc.setGenerateJobSpec(generateBinaryRuntime);
+                false, printRewrittenExpressions, printLogicalPlan, printOptimizedPlan, printPhysicalOpsOnly,
+                generateBinaryRuntime, printJob);
 
         AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, writer, pc, DisplayFormat.TEXT);
         aqlTranslator.compileAndExecute(hcc);
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
index 08e1c5f..80293b0 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/AqlTranslator.java
@@ -650,7 +650,9 @@
                 .getDatasetName().getValue(), st1.getQuery(), st1.getVarCounter());
 
         Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        jobsToExecute.add(compiled.first);
+        if (compiled.first != null) {
+            jobsToExecute.add(compiled.first);
+        }
     }
 
     private void handleInsertStatement(AqlMetadataProvider metadataProvider, Statement stmt,
@@ -662,7 +664,9 @@
         CompiledInsertStatement clfrqs = new CompiledInsertStatement(dataverseName, stmtInsert.getDatasetName()
                 .getValue(), stmtInsert.getQuery(), stmtInsert.getVarCounter());
         Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        jobsToExecute.add(compiled.first);
+        if (compiled.first != null) {
+            jobsToExecute.add(compiled.first);
+        }
     }
 
     private void handleDeleteStatement(AqlMetadataProvider metadataProvider, Statement stmt,
@@ -675,7 +679,9 @@
                 stmtDelete.getDatasetName().getValue(), stmtDelete.getCondition(), stmtDelete.getDieClause(),
                 stmtDelete.getVarCounter(), metadataProvider);
         Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        jobsToExecute.add(compiled.first);
+        if (compiled.first != null) {
+            jobsToExecute.add(compiled.first);
+        }
     }
 
     private Pair<JobSpecification, FileSplit> rewriteCompileQuery(AqlMetadataProvider metadataProvider, Query query,
@@ -686,15 +692,12 @@
         Pair<Query, Integer> reWrittenQuery = APIFramework.reWriteQuery(declaredFunctions, metadataProvider, query,
                 sessionConfig, out, pdf);
 
-        // Query Compilation (happens under the same ongoing metadata
-        // transaction)
-        sessionConfig.setGenerateJobSpec(true);
+        // Query Compilation (happens under the same ongoing metadata transaction)
         if (metadataProvider.isWriteTransaction()) {
             metadataProvider.setJobTxnId(TransactionIDFactory.generateTransactionId());
         }
         JobSpecification spec = APIFramework.compileQuery(declaredFunctions, metadataProvider, query,
                 reWrittenQuery.second, stmt == null ? null : stmt.getDatasetName(), sessionConfig, out, pdf, stmt);
-        sessionConfig.setGenerateJobSpec(false);
 
         Pair<JobSpecification, FileSplit> compiled = new Pair<JobSpecification, FileSplit>(spec,
                 metadataProvider.getOutputFile());
@@ -721,7 +724,9 @@
         bfs.initialize(metadataProvider.getMetadataTxnContext(), dataset);
         cbfs.setQuery(bfs.getQuery());
         Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, bfs.getQuery(), cbfs);
-        jobsToExecute.add(compiled.first);
+        if (compiled.first != null) {
+            jobsToExecute.add(compiled.first);
+        }
     }
 
     private void handleControlFeedStatement(AqlMetadataProvider metadataProvider, Statement stmt,
@@ -737,8 +742,10 @@
     private QueryResult handleQuery(AqlMetadataProvider metadataProvider, Query query, IHyracksClientConnection hcc,
             List<JobSpecification> jobsToExecute) throws Exception {
         Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, query, null);
-        GlobalConfig.ASTERIX_LOGGER.info(compiled.first.toJSON().toString(1));
-        jobsToExecute.add(compiled.first);
+        if (compiled.first != null) {
+            GlobalConfig.ASTERIX_LOGGER.info(compiled.first.toJSON().toString(1));
+            jobsToExecute.add(compiled.first);
+        }
         return new QueryResult(query, compiled.second.getLocalFile().getFile().getAbsolutePath());
     }
 
diff --git a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
index 0c0b104..43c6c0c 100644
--- a/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
+++ b/asterix-app/src/test/java/edu/uci/ics/asterix/test/optimizer/OptimizerTest.java
@@ -126,7 +126,7 @@
             AsterixJavaClient asterix = new AsterixJavaClient(
                     AsterixHyracksIntegrationUtil.getHyracksClientConnection(), query, plan);
             try {
-                asterix.compile(true, false, false, true, true, true, false);
+                asterix.compile(true, false, false, true, true, false, false);
             } catch (AsterixException e) {
                 plan.close();
                 query.close();
