Fixed OptimizerTests that I broke in an earlier commit.
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_stabilization@596 eaa15691-b419-025a-1212-ee371bd00084
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 05e560a..57b2ff0 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
@@ -469,30 +469,36 @@
ICompiler compiler = compilerFactory.createCompiler(planAndMetadata.getPlan(),
planAndMetadata.getMetadataProvider(), t.getVarCounter());
if (pc.isOptimize()) {
- compiler.optimize();
+ compiler.optimize();
if (pc.isPrintOptimizedLogicalPlanParam()) {
- switch (pdf) {
- case HTML: {
- out.println("<H1>Optimized logical plan:</H1>");
- out.println("<PRE>");
- break;
- }
- case TEXT: {
- out.println("----------Optimized plan ");
- break;
- }
- }
-
- if (q != null) {
+ if (pc.isPrintPhysicalOpsOnly()) {
+ // For Optimizer tests.
StringBuilder buffer = new StringBuilder();
- PlanPrettyPrinter.printPlan(planAndMetadata.getPlan(), buffer, pvisitor, 0);
+ PlanPrettyPrinter.printPhysicalOps(planAndMetadata.getPlan(), buffer, 0);
out.print(buffer);
- }
- switch (pdf) {
- case HTML: {
- out.println("</PRE>");
- break;
- }
+ } else {
+ switch (pdf) {
+ case HTML: {
+ out.println("<H1>Optimized logical plan:</H1>");
+ out.println("<PRE>");
+ break;
+ }
+ case TEXT: {
+ out.println("----------Optimized plan ");
+ break;
+ }
+ }
+ if (q != null) {
+ StringBuilder buffer = new StringBuilder();
+ PlanPrettyPrinter.printPlan(planAndMetadata.getPlan(), buffer, pvisitor, 0);
+ out.print(buffer);
+ }
+ switch (pdf) {
+ case HTML: {
+ out.println("</PRE>");
+ break;
+ }
+ }
}
}
}
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 d60971b..b31fa92 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, false, true, true, false);
+ asterix.compile(true, false, false, true, true, true, false);
} catch (AsterixException e) {
plan.close();
query.close();