diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
index fdf9c0b..762fa8f 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/translator/AqlExpressionToPlanTranslator.java
@@ -83,8 +83,8 @@
 import edu.uci.ics.asterix.metadata.declared.AqlDataSource;
 import edu.uci.ics.asterix.metadata.declared.AqlMetadataProvider;
 import edu.uci.ics.asterix.metadata.declared.AqlSourceId;
-import edu.uci.ics.asterix.metadata.declared.FileSplitDataSink;
-import edu.uci.ics.asterix.metadata.declared.FileSplitSinkId;
+import edu.uci.ics.asterix.metadata.declared.ResultSetDataSink;
+import edu.uci.ics.asterix.metadata.declared.ResultSetSinkId;
 import edu.uci.ics.asterix.metadata.entities.Dataset;
 import edu.uci.ics.asterix.metadata.entities.Function;
 import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
@@ -197,10 +197,12 @@
                 outputFileSplit = getDefaultOutputFileLocation();
             }
             metadataProvider.setOutputFile(outputFileSplit);
+            String resultNodeName = outputFileSplit.getNodeName();
+
             List<Mutable<ILogicalExpression>> writeExprList = new ArrayList<Mutable<ILogicalExpression>>(1);
             writeExprList.add(new MutableObject<ILogicalExpression>(new VariableReferenceExpression(resVar)));
-            FileSplitSinkId fssi = new FileSplitSinkId(outputFileSplit);
-            FileSplitDataSink sink = new FileSplitDataSink(fssi, null);
+            ResultSetSinkId rssId = new ResultSetSinkId(metadataProvider.getResultSetId(), resultNodeName);
+            ResultSetDataSink sink = new ResultSetDataSink(rssId, null);
             topOp = new WriteOperator(writeExprList, sink);
             topOp.getInputs().add(new MutableObject<ILogicalOperator>(project));
         } else {
diff --git a/asterix-app/pom.xml b/asterix-app/pom.xml
index 9476178..ac63075 100644
--- a/asterix-app/pom.xml
+++ b/asterix-app/pom.xml
@@ -140,6 +140,11 @@
 			<artifactId>algebricks-compiler</artifactId>
 		</dependency>
 		<dependency>
+            <groupId>edu.uci.ics.hyracks</groupId>
+            <artifactId>hyracks-client</artifactId>
+            <version>0.2.3-SNAPSHOT</version>
+        </dependency>
+		<dependency>
 			<groupId>edu.uci.ics.asterix</groupId>
 			<artifactId>asterix-aql</artifactId>
 			<version>0.0.4-SNAPSHOT</version>
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 1eb37cd..4062392 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
@@ -146,7 +146,8 @@
 
     public enum DisplayFormat {
         TEXT,
-        HTML
+        HTML,
+        JSON
     }
 
     public static Pair<Query, Integer> reWriteQuery(List<FunctionDecl> declaredFunctions,
@@ -320,7 +321,7 @@
         if (!pc.isGenerateJobSpec()) {
             return null;
         }
-        
+
         AlgebricksPartitionConstraint clusterLocs = queryMetadataProvider.getClusterLocations();
         builder.setBinaryBooleanInspectorFactory(format.getBinaryBooleanInspectorFactory());
         builder.setBinaryIntegerInspectorFactory(format.getBinaryIntegerInspectorFactory());
@@ -331,7 +332,16 @@
         builder.setHashFunctionFactoryProvider(format.getBinaryHashFunctionFactoryProvider());
         builder.setHashFunctionFamilyProvider(format.getBinaryHashFunctionFamilyProvider());
         builder.setNullWriterFactory(format.getNullWriterFactory());
-        builder.setPrinterProvider(format.getPrinterFactoryProvider());
+
+        switch (pdf) {
+            case JSON:
+                builder.setPrinterProvider(format.getJSONPrinterFactoryProvider());
+                break;
+            default:
+                builder.setPrinterProvider(format.getPrinterFactoryProvider());
+                break;
+        }
+
         builder.setSerializerDeserializerProvider(format.getSerdeProvider());
         builder.setTypeTraitProvider(format.getTypeTraitProvider());
         builder.setNormalizedKeyComputerFactoryProvider(format.getNormalizedKeyComputerFactoryProvider());
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 034e1f4..2122ada 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
@@ -18,7 +18,6 @@
 import edu.uci.ics.asterix.aql.parser.AQLParser;
 import edu.uci.ics.asterix.aql.parser.ParseException;
 import edu.uci.ics.asterix.aql.translator.AqlTranslator;
-import edu.uci.ics.asterix.aql.translator.QueryResult;
 import edu.uci.ics.asterix.metadata.MetadataManager;
 import edu.uci.ics.hyracks.api.client.HyracksConnection;
 import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
@@ -28,8 +27,292 @@
 
     private static final String HYRACKS_CONNECTION_ATTR = "edu.uci.ics.asterix.HYRACKS_CONNECTION";
 
+    private static final String HTML_HEADER_TEMPLATE = "<!DOCTYPE html>"
+            + "<html lang=\"en\">"
+            + "<head>"
+            + "<meta name=\"description\" content=\"ASTERIX WEB PAGE\" />"
+            + "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">"
+            + "<link href='http://fonts.googleapis.com/css?family=Bitter|PT+Sans+Caption|Open+Sans' rel='stylesheet' type='text/css'>"
+            + "<script src=\"http://code.jquery.com/jquery.min.js\"></script>"
+            + "<script src=\"http://www.jacklmoore.com/autosize/jquery.autosize.js\"></script>"
+            + "  "
+            + "<link href=\"http://twitter.github.com/bootstrap/assets/css/bootstrap.css\" rel=\"stylesheet\" type=\"text/css\" />"
+            + "<link href=\"http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css\" rel=\"stylesheet\">"
+            + ""
+            + "  "
+            + "<script src=\"http://twitter.github.com/bootstrap/assets/js/bootstrap.js\"></script>"
+            + ""
+            + "<script type=\"text/javascript\">"
+            + "$(document).ready(function(){"
+            + "   $('textarea').autosize();"
+            + "});"
+            + "</script>"
+            + ""
+            + "<meta charset=utf-8 />"
+            + "<title>ASTERIX Demo</title>"
+            + "<style id=\"jsbin-css\">"
+            + "body {"
+            + "    background: none repeat scroll 0 0 white;"
+            + "    color: #222222;"
+            + "    font-family: 'Bitter';"
+            + "    font-size: 14px;"
+            + "    line-height: 17px;"
+            + "    width: 100%;"
+            + "}"
+            + ""
+            + ".content {"
+            + "    margin-top: 70px;"
+            + "}"
+            + ""
+            + "label.query, label.result {"
+            + "    font-size: 24px;"
+            + "    padding-bottom: 10px;"
+            + "    font-weight: bold;"
+            + "}"
+            + ""
+            + "div.host {"
+            + "    float: left;"
+            + "    margin: 0 100px 0 10px;"
+            + "}"
+            + ""
+            + "div.port {"
+            + "}"
+            + ""
+            + "div.left {"
+            + "    float: left;"
+            + "    width: 320px;"
+            + "    padding: 0 20px 0 10px;"
+            + "}"
+            + ""
+            + "div.right {"
+            + "}"
+            + ""
+            + "button.btn {"
+            + "    clear: both;"
+            + "    float: left;"
+            + "    margin: 20px 0 0 10px;;"
+            + "}"
+            + ""
+            + "textarea.query {"
+            + "    -webkit-box-sizing: border-box;"
+            + "    -moz-box-sizing: border-box;"
+            + "    -ms-box-sizing: border-box;"
+            + "    box-sizing: border-box;"
+            + "    font-size: 16px;"
+            + "    line-height: 20px;"
+            + "    font-family: bitter, helvetica;"
+            + "    width: 100%;"
+            + "    padding: 10px;"
+            + "    color: #999;"
+            + "    resize: none;"
+            + "    border: 10px solid #eee;"
+            + "}"
+            + ""
+            + "textarea.query:focus {"
+            + "    outline: none;"
+            + "    color: #333;"
+            + "}"
+            + ""
+            + "label {"
+            + "    padding-top: 10px;"
+            + "}"
+            + ""
+            + "input[type=text] {"
+            + "    height: 20px;"
+            + "}"
+            + ""
+            + ""
+            + "div.output label.heading {"
+            + "    font-size: 24px;"
+            + "    margin-top: 2px;"
+            + "    padding-bottom: 10px;"
+            + "    font-weight: bold;"
+            + "}"
+            + ""
+            + "div.output .message {"
+            + "    -webkit-box-sizing: border-box;"
+            + "    -moz-box-sizing: border-box;"
+            + "    -ms-box-sizing: border-box;"
+            + "    box-sizing: border-box;"
+            + "    -webkit-border-radius: 4px 4px 4px 4px;"
+            + "    -moz-border-radius: 4px 4px 4px 4px;"
+            + "    -ms-border-radius: 4px 4px 4px 4px;"
+            + "    border-radius: 4px 4px 4px 4px;"
+            + "    color: #000;"
+            + "    resize: none;"
+            + "    border: 1px solid #eee;"
+            + "}"
+            + ""
+            + "div.error label.heading {"
+            + "    color: #ff2020;"
+            + "    font-size: 24px;"
+            + "    margin-top: 2px;"
+            + "    padding-bottom: 10px;"
+            + "    font-weight: bold;"
+            + "}"
+            + ""
+            + "div.error .message {"
+            + "    -webkit-box-sizing: border-box;"
+            + "    -moz-box-sizing: border-box;"
+            + "    -ms-box-sizing: border-box;"
+            + "    box-sizing: border-box;"
+            + "    border-color: rgba(82, 168, 236, 0.8);"
+            + "    outline: 0;"
+            + "    outline: thin dotted 9;"
+            + ""
+            + "    -webkit-box-shadow: inset 0 1px 1px rgba(250, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 0.8);"
+            + "    -moz-box-shadow: inset 0 1px 1px rgba(250, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 1.0);"
+            + "    box-shadow: inset 0 1px 1px rgba(250, 0, 0, 0.075), 0 0 8px rgba(255, 0, 0, 1.0);"
+            + "    color: #000;"
+            + "    resize: none;"
+            + "    border: 1px solid #eee;"
+            + "    margin-top: 7px;"
+            + "    padding: 20px 20px 20px 20px;"
+            + "}"
+            + ""
+            + ".footer {"
+            + "   margin-top: 40px;"
+            + "}"
+            + ""
+            + ".footer .line {"
+            + "    border-top: 1px solid #EEEEEE;"
+            + "    bottom: 20px;"
+            + "    height: 10px;"
+            + "    left: 0;"
+            + "    position: fixed;"
+            + "    width: 100%;"
+            + "}"
+            + ""
+            + ".footer .content {"
+            + "    background: none repeat scroll 0 0 #FFFFFF;"
+            + "    bottom: 0;"
+            + "    color: #666666;"
+            + "    font-size: 12px;"
+            + "    height: 25px;"
+            + "    left: 0;"
+            + "    padding-top: 5px;"
+            + "    position: fixed;"
+            + "    width: 100%;"
+            + "}"
+            + ""
+            + ".footer .content .left {"
+            + "    padding-left: 20px;"
+            + "    float: left;"
+            + "}"
+            + ""
+            + ".footer .content .right {"
+            + "    padding-right: 20px;"
+            + "    float: right;"
+            + "}</style></head>"
+            + "<body>"
+            + "  <div class=\"navbar navbar-inverse navbar-fixed-top\">"
+            + "    <div class=\"navbar-inner\">"
+            + "      <div class=\"container\">"
+            + "        <a class=\"btn btn-navbar\" data-toggle=\"collapse\" data-target=\".nav-collapse\">"
+            + "          <span class=\"icon-bar\"></span>"
+            + "          <span class=\"icon-bar\"></span>"
+            + "          <span class=\"icon-bar\"></span>"
+            + "        </a>"
+            + "        <a class=\"brand\" href=\"#\">ASTERIX</a>"
+            + "        <div class=\"nav-collapse collapse\">"
+            + "          <ul class=\"nav\">"
+            + "            <li><a href=\"#\">Open source</a></li>"
+            + "            <li><a href=\"#about\">File issues</a></li>"
+            + "            <li><a href=\"#contact\">Contact</a></li>"
+            + "          </ul>"
+            + "        </div><!--/.nav-collapse -->"
+            + "      </div>"
+            + "    </div>"
+            + "  </div>"
+            + "";
+    private static final String HTML_FORM_CONTENT_TEMPLATE = "  <div class=\"content\">"
+            + "    <div class=\"container\">"
+            + "      <div class=\"row-fluid\">"
+            + "        <div class=\"span6\">"
+            + "          <form class=\"form-horizontal\" method=\"post\">"
+            + "            <div>"
+            + "              <label class=\"query\">Query</label>"
+            + "              <textarea rows=\"20\" name=\"query\" class=\"query\" value=\"%s\" placeholder=\"Type your AQL query ...\"></textarea>"
+            + "            </div>"
+            + "            <div>"
+            + "              <div class=\"host\">"
+            + "                <label>Host</label><input type=\"text\" name=\"hyracks-ip\" placeholder=\"IP Address or hostname\"/>"
+            + "              </div>"
+            + "              <div class=\"port\">"
+            + "                <label>Port</label><input type=\"text\" name=\"hyracks-port\" placeholder=\"Port number\"/>"
+            + "              </div>"
+            + "            </div>"
+            + "            <div>"
+            + "              <div class=\"left\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"print-expr-tree\" value=\"true\" /> Print parsed expressions</label>"
+            + "              </div>"
+            + "              <div class=\"right\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"print-rewritten-expr-tree\" value=\"true\" /> Print rewritten expressions</label>"
+            + "              </div>"
+            + "            </div>"
+            + "            <div>"
+            + "              <div class=\"left\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"print-logical-plan\" value=\"true\" /> Print logical plan</label>"
+            + "              </div>"
+            + "              <div class=\"right\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"print-optimized-logical-plan\" value=\"true\" /> Print optimized logical plan</label>"
+            + "              </div>"
+            + "            </div>"
+            + "            <div>"
+            + "              <div class=\"left\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"print-job\" value=\"true\" /> Print hyracks job</label>"
+            + "              </div>"
+            + "              <div class=\"right\">"
+            + "                <label class=\"checkbox\"><input type=\"checkbox\" name=\"display-result\" value=\"true\" /> Display error/results</label>"
+            + "              </div>"
+            + "            </div>"
+            + "            <button type=\"submit\" class=\"btn btn-danger\">Execute</button>"
+            + "          </form>"
+            + "        </div>";
+
+    private static final String HTML_EMPTY_OUTPUT_TEMPLATE = "        <div class=\"span6\">"
+            + "          <div class=\"output\">"
+            + "            <label class=\"heading\">Output</label>"
+            + "            <div class=\"message\">"
+            + "            </div>"
+            + "          </div>"
+            + "        </div>";
+
+    private static final String HTML_OUTPUT_TEMPLATE = "<div class=\"span6\">"
+            + "  <div class=\"output\">"
+            + "    <label class=\"heading\">Output</label>"
+            + "    <table class=\"table table-bordered table-striped\">"
+            + "      %s"
+            + "    </table>"
+            + "  </div>"
+            + "</div>";
+
+    private static final String HTML_FOOTER_TEMPLATE = "      </div>"
+            + "    </div>"
+            + "  </div>"
+            + "  <div class=\"footer\">"
+            + "    <section class=\"line\"><hr></section>"
+            + "    <section class=\"content\">"
+            + "      <section class=\"left\">"
+            + "        Developed by ASTERIX group"
+            + "      </section>"
+            + "      <section class=\"right\">"
+            + "        &copy; Copyright 2012 University of California, Irvine"
+            + "      </section>"
+            + "    </section>"
+            + "  </div>"
+            + "</body>"
+            + "</html>";
+
     @Override
     public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        DisplayFormat format = DisplayFormat.HTML;
+        if (request.getContentType().equals("application/json")) {
+            format = DisplayFormat.JSON;
+        } else if (request.getContentType().equals("text/plain")) {
+            format = DisplayFormat.TEXT;
+        }
+
         String query = request.getParameter("query");
         String printExprParam = request.getParameter("print-expr-tree");
         String printRewrittenExprParam = request.getParameter("print-rewritten-expr-tree");
@@ -60,34 +343,13 @@
                     isSet(printRewrittenExprParam), isSet(printLogicalPlanParam),
                     isSet(printOptimizedLogicalPlanParam), false, true, isSet(printJob));
             MetadataManager.INSTANCE.init();
-            AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, out, sessionConfig, DisplayFormat.HTML);
-            List<QueryResult> executionResults = null;
+            AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, out, sessionConfig, format);
             double duration = 0;
             long startTime = System.currentTimeMillis();
-            executionResults = aqlTranslator.compileAndExecute(hcc);
+            aqlTranslator.compileAndExecute(hcc, false);
             long endTime = System.currentTimeMillis();
             duration = (endTime - startTime) / 1000.00;
             out.println("<PRE>Duration of all jobs: " + duration + "</PRE>");
-
-            int queryCount = 1;
-            out.println("<H1>Result:</H1>");
-            out.println("<PRE>");
-            for (QueryResult result : executionResults) {
-                out.println("Query:" + queryCount++ + ":" + " " + result.getResultPath());
-            }
-            out.println("Duration: " + duration);
-            out.println("</PRE>");
-
-            queryCount = 1;
-            if (isSet(strDisplayResult)) {
-                out.println("<PRE>");
-                for (QueryResult result : executionResults) {
-                    out.println("Query:" + queryCount++ + ":" + " " + result.getResultPath());
-                    displayFile(new File(result.getResultPath()), out);
-                    out.println();
-                }
-                out.println("</PRE>");
-            }
         } catch (ParseException pe) {
             String message = pe.getMessage();
             message = message.replace("<", "&lt");
@@ -110,21 +372,8 @@
     public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
         PrintWriter out = response.getWriter();
         response.setContentType("text/html");
-        final String form = "<form method=\"post\">"
-                + "<center><textarea cols=\"80\" rows=\"25\" name=\"query\" ></textarea><br/>"
-                + "IP Address: <input type = \"text\" name = \"hyracks-ip\" size=\"15\" maxlength=\"35\" value=\"localhost\" /><br/>"
-                + "Port: <input type = \"text\" name = \"hyracks-port\" size=\"5\" maxlength=\"5\" value=\"1098\" /><br/>"
-                + "<input type = \"checkbox\" name = \"print-expr-tree\" value=\"true\" />print parsed expressions<P>"
-                + "<input type = \"checkbox\" name = \"print-rewritten-expr-tree\" value=\"true\" />print rewritten expressions<P>"
-                + "<input type = \"checkbox\" name = \"print-logical-plan\" value=\"true\" checked/>print logical plan<P>"
-                + "<input type = \"checkbox\" name = \"print-optimized-logical-plan\" value=\"true\" checked/>print optimized logical plan<P>"
-                + "<input type = \"checkbox\" name = \"print-job\" value=\"true\" checked/>print Hyracks job<P>"
-                + "<input type = \"checkbox\" name = \"display-result\" value=\"true\" checked/>display NFS file<P>"
-                // +
-                // "<input type = \"checkbox\" name = \"serialize-as-xml\" value=\"true\">serialize as XML<P>"
-                // +
-                // "<input type = \"checkbox\" name = \"show-tuples\" value=\"true\">show the entire tuples<P>"
-                + "<input type=\"submit\"/>" + "</center>" + "</form>";
+        final String form = HTML_HEADER_TEMPLATE + String.format(HTML_FORM_CONTENT_TEMPLATE, "")
+                + HTML_EMPTY_OUTPUT_TEMPLATE + HTML_FOOTER_TEMPLATE;
         out.println(form);
     }
 
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java
new file mode 100644
index 0000000..1ae3054
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/DDLAPIServlet.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
+
+public class DDLAPIServlet extends RESTAPIServlet {
+    private static final long serialVersionUID = 1L;
+
+    protected String getQueryParameter(HttpServletRequest request) {
+        return request.getParameter("ddl");
+    }
+
+    protected List<Statement.Kind> getAllowedStatements() {
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATAVERSE_DROP, Kind.FUNCTION_DECL, Kind.NODEGROUP_DECL,
+                Kind.NODEGROUP_DROP, Kind.TYPE_DECL, Kind.TYPE_DROP, Kind.CREATE_INDEX, Kind.INDEX_DECL,
+                Kind.CREATE_DATAVERSE, Kind.INDEX_DROP, Kind.CREATE_FUNCTION, Kind.FUNCTION_DROP };
+        return Arrays.asList(statementsArray);
+    }
+
+    protected String getErrorMessage() {
+        return "Invalid statement: Non-DDL statement %s to the DDL API.";
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/HyracksProperties.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/HyracksProperties.java
new file mode 100644
index 0000000..c5b532a
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/HyracksProperties.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+public class HyracksProperties {
+    private final InputStream is;
+
+    private final Properties properties;
+
+    private static String HYRACKS_IP = "127.0.0.1";
+
+    private static int HYRACKS_PORT = 1098;
+
+    public HyracksProperties() throws IOException {
+        is = HyracksProperties.class.getClassLoader().getResourceAsStream("hyracks-deployment.properties");
+        properties = new Properties();
+        properties.load(is);
+    }
+
+    public String getHyracksIPAddress() {
+        String strIP = properties.getProperty("cc.ip");
+        if (strIP == null) {
+            strIP = HYRACKS_IP;
+        }
+        return strIP;
+    }
+
+    public int getHyracksPort() {
+        String strPort = properties.getProperty("cc.port");
+        int port = HYRACKS_PORT;
+        if (strPort != null) {
+            port = Integer.parseInt(strPort);
+        }
+        return port;
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java
new file mode 100644
index 0000000..a893bd6
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryAPIServlet.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
+
+public class QueryAPIServlet extends RESTAPIServlet {
+    private static final long serialVersionUID = 1L;
+
+    protected String getQueryParameter(HttpServletRequest request) {
+        return request.getParameter("query");
+    }
+
+    protected List<Statement.Kind> getAllowedStatements() {
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.QUERY, Kind.SET, Kind.WRITE, Kind.BEGIN_FEED,
+                Kind.CONTROL_FEED };
+        return Arrays.asList(statementsArray);
+    }
+
+    protected String getErrorMessage() {
+        return "Invalid statement: Non-query statement %s to the query API.";
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryResultAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryResultAPIServlet.java
new file mode 100644
index 0000000..2b0aff4
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryResultAPIServlet.java
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.nio.ByteBuffer;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.result.ResultReader;
+import edu.uci.ics.asterix.result.ResultUtils;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
+import edu.uci.ics.hyracks.api.job.JobId;
+
+public class QueryResultAPIServlet extends HttpServlet {
+    private static final long serialVersionUID = 1L;
+
+    private static final String HYRACKS_CONNECTION_ATTR = "edu.uci.ics.asterix.HYRACKS_CONNECTION";
+
+    @Override
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        String strHandle = request.getParameter("handle");
+        PrintWriter out = response.getWriter();
+        response.setContentType("text/html");
+        ServletContext context = getServletContext();
+        IHyracksClientConnection hcc;
+        try {
+            HyracksProperties hp = new HyracksProperties();
+            String strIP = hp.getHyracksIPAddress();
+            int port = hp.getHyracksPort();
+
+            synchronized (context) {
+                hcc = (IHyracksClientConnection) context.getAttribute(HYRACKS_CONNECTION_ATTR);
+                if (hcc == null) {
+                    hcc = new HyracksConnection(strIP, port);
+                    context.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
+                }
+            }
+            JSONObject handleObj = new JSONObject(strHandle);
+            JSONArray handle = handleObj.getJSONArray("handle");
+            JobId jobId = new JobId(handle.getLong(0));
+            ResultSetId rsId = new ResultSetId(handle.getLong(1));
+            ByteBuffer buffer = ByteBuffer.allocate(ResultReader.FRAME_SIZE);
+            /* TODO(madhusudancs): We need to find a way to JSON serialize default format obtained from
+             * metadataProvider in the AQLTranslator and store it as part of the result handle.
+             */
+            ResultReader resultReader = new ResultReader(hcc);
+            resultReader.open(jobId, rsId);
+            buffer.clear();
+            JSONObject jsonResponse = new JSONObject();
+            JSONArray results = new JSONArray();
+            while (resultReader.read(buffer) > 0) {
+                results.put(ResultUtils.getJSONFromBuffer(buffer, resultReader.getFrameTupleAccessor()));
+            }
+            jsonResponse.put("results", results);
+            out.write(jsonResponse.toString());
+
+        } catch (Exception e) {
+            out.println(e.getMessage());
+            e.printStackTrace(out);
+        }
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryStatusAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryStatusAPIServlet.java
new file mode 100644
index 0000000..f36e4e3
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/QueryStatusAPIServlet.java
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.result.ResultReader;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
+import edu.uci.ics.hyracks.api.job.JobId;
+
+public class QueryStatusAPIServlet extends HttpServlet {
+    private static final long serialVersionUID = 1L;
+
+    private static final String HYRACKS_CONNECTION_ATTR = "edu.uci.ics.asterix.HYRACKS_CONNECTION";
+
+    @Override
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        String strHandle = request.getParameter("handle");
+        PrintWriter out = response.getWriter();
+        response.setContentType("text/html");
+        ServletContext context = getServletContext();
+        IHyracksClientConnection hcc;
+        try {
+            HyracksProperties hp = new HyracksProperties();
+            String strIP = hp.getHyracksIPAddress();
+            int port = hp.getHyracksPort();
+
+            synchronized (context) {
+                hcc = (IHyracksClientConnection) context.getAttribute(HYRACKS_CONNECTION_ATTR);
+                if (hcc == null) {
+                    hcc = new HyracksConnection(strIP, port);
+                    context.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
+                }
+            }
+            JSONObject handleObj = new JSONObject(strHandle);
+            JSONArray handle = handleObj.getJSONArray("handle");
+            JobId jobId = new JobId(handle.getLong(0));
+            ResultSetId rsId = new ResultSetId(handle.getLong(1));
+
+            /* TODO(madhusudancs): We need to find a way to JSON serialize default format obtained from
+             * metadataProvider in the AQLTranslator and store it as part of the result handle.
+             */
+            ResultReader resultReader = new ResultReader(hcc);
+            resultReader.open(jobId, rsId);
+
+            JSONObject jsonResponse = new JSONObject();
+            String status;
+            switch (resultReader.getStatus()) {
+                case RUNNING:
+                    status = "RUNNING";
+                    break;
+                case FAILED:
+                    status = "ERROR";
+                    break;
+                case SUCCESS:
+                    status = "SUCCESS";
+                    break;
+                default:
+                    status = "ERROR";
+                    break;
+            }
+            jsonResponse.put("status", status);
+            out.write(jsonResponse.toString());
+
+        } catch (Exception e) {
+            out.println(e.getMessage());
+            e.printStackTrace(out);
+        }
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/RESTAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/RESTAPIServlet.java
new file mode 100644
index 0000000..f0aa3c5
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/RESTAPIServlet.java
@@ -0,0 +1,141 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringReader;
+import java.util.List;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.json.JSONObject;
+
+import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
+import edu.uci.ics.asterix.api.common.SessionConfig;
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
+import edu.uci.ics.asterix.aql.parser.AQLParser;
+import edu.uci.ics.asterix.aql.parser.ParseException;
+import edu.uci.ics.asterix.aql.translator.AqlTranslator;
+import edu.uci.ics.asterix.metadata.MetadataManager;
+import edu.uci.ics.asterix.result.ResultUtils;
+import edu.uci.ics.hyracks.api.client.HyracksConnection;
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+
+abstract class RESTAPIServlet extends HttpServlet {
+    private static final long serialVersionUID = 1L;
+
+    private static final String HYRACKS_CONNECTION_ATTR = "edu.uci.ics.asterix.HYRACKS_CONNECTION";
+
+    @Override
+    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
+        PrintWriter out = response.getWriter();
+
+        DisplayFormat format = DisplayFormat.HTML;
+
+        String contentType = request.getContentType();
+
+        if ((contentType == null) || (contentType.equals("text/plain"))) {
+            format = DisplayFormat.TEXT;
+        } else if (contentType.equals("application/json")) {
+            format = DisplayFormat.JSON;
+        }
+
+        String query = getQueryParameter(request);
+        boolean asyncResults = isAsync(request);
+
+        response.setContentType("application/json");
+        ServletContext context = getServletContext();
+        IHyracksClientConnection hcc;
+
+        try {
+            HyracksProperties hp = new HyracksProperties();
+            String strIP = hp.getHyracksIPAddress();
+            int port = hp.getHyracksPort();
+
+            synchronized (context) {
+                hcc = (IHyracksClientConnection) context.getAttribute(HYRACKS_CONNECTION_ATTR);
+                if (hcc == null) {
+                    hcc = new HyracksConnection(strIP, port);
+                    context.setAttribute(HYRACKS_CONNECTION_ATTR, hcc);
+                }
+            }
+
+            AQLParser parser = new AQLParser(query);
+            List<Statement> aqlStatements = parser.Statement();
+            if (checkForbiddenStatements(aqlStatements, out)) {
+                return;
+            }
+            SessionConfig sessionConfig = new SessionConfig(port, true, false, false, false, false, false, true, false);
+
+            MetadataManager.INSTANCE.init();
+
+            AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, out, sessionConfig, format);
+
+            aqlTranslator.compileAndExecute(hcc, asyncResults);
+
+        } catch (ParseException pe) {
+            StringBuilder errorMessage = new StringBuilder();
+            String message = pe.getMessage();
+            message = message.replace("<", "&lt");
+            message = message.replace(">", "&gt");
+            errorMessage.append("SyntaxError:" + message + "\n");
+            int pos = message.indexOf("line");
+            if (pos > 0) {
+                int columnPos = message.indexOf(",", pos + 1 + "line".length());
+                int lineNo = Integer.parseInt(message.substring(pos + "line".length() + 1, columnPos));
+                String line = query.split("\n")[lineNo - 1];
+                errorMessage.append("==> " + line + "\n");
+            }
+            JSONObject errorResp = ResultUtils.getErrorResponse(2, errorMessage.toString());
+            out.write(errorResp.toString());
+        } catch (Exception e) {
+            StringBuilder errorMessage = new StringBuilder();
+            errorMessage.append(e.getMessage());
+            JSONObject errorResp = ResultUtils.getErrorResponse(99, errorMessage.toString());
+            out.write(errorResp.toString());
+        }
+    }
+
+    private boolean checkForbiddenStatements(List<Statement> aqlStatements, PrintWriter out) {
+        for (Statement st : aqlStatements) {
+            if (!getAllowedStatements().contains(st.getKind())) {
+                JSONObject errorResp = ResultUtils.getErrorResponse(1, String.format(getErrorMessage(), st.getKind()));
+                out.write(errorResp.toString());
+                return true;
+            }
+        }
+        return false;
+    }
+
+    protected boolean isAsync(HttpServletRequest request) {
+        String mode = request.getParameter("mode");
+        boolean asyncResults = false;
+        if (mode != null && mode.equals("asynchronous")) {
+            asyncResults = true;
+        }
+        return asyncResults;
+    }
+
+    protected abstract String getQueryParameter(HttpServletRequest request);
+
+    protected abstract List<Kind> getAllowedStatements();
+
+    protected abstract String getErrorMessage();
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java
new file mode 100644
index 0000000..7336876
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/api/http/servlet/UpdateAPIServlet.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2009-2011 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.api.http.servlet;
+
+import java.util.Arrays;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
+
+public class UpdateAPIServlet extends RESTAPIServlet {
+    private static final long serialVersionUID = 1L;
+
+    protected String getQueryParameter(HttpServletRequest request) {
+        return request.getParameter("statements");
+    }
+
+    protected List<Statement.Kind> getAllowedStatements() {
+        Kind[] statementsArray = { Kind.DATAVERSE_DECL, Kind.DATASET_DECL, Kind.DATASET_DROP, Kind.DELETE, Kind.INSERT,
+                Kind.UPDATE, Kind.DML_CMD_LIST, Kind.LOAD_FROM_FILE, Kind.WRITE_FROM_QUERY_RESULT };
+        return Arrays.asList(statementsArray);
+    }
+
+    protected String getErrorMessage() {
+        return "Invalid statement: Non-Update statement %s to the Update API.";
+    }
+}
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 7e72d94..fb09299 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
@@ -52,7 +52,7 @@
         int ch;
         StringBuilder builder = new StringBuilder();
         while ((ch = queryText.read()) != -1) {
-            builder.append((char)ch);
+            builder.append((char) ch);
         }
         AQLParser parser = new AQLParser(builder.toString());
         List<Statement> aqlStatements;
@@ -68,7 +68,7 @@
                 generateBinaryRuntime, printJob);
 
         AqlTranslator aqlTranslator = new AqlTranslator(aqlStatements, writer, pc, DisplayFormat.TEXT);
-        aqlTranslator.compileAndExecute(hcc);
+        aqlTranslator.compileAndExecute(hcc, false);
         writer.flush();
     }
 
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 66239e2..d6d9382 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
@@ -16,6 +16,7 @@
 
 import java.io.File;
 import java.io.PrintWriter;
+import java.nio.ByteBuffer;
 import java.rmi.RemoteException;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -23,12 +24,15 @@
 import java.util.Map;
 
 import org.json.JSONException;
+import org.json.JSONArray;
+import org.json.JSONObject;
 
 import edu.uci.ics.asterix.api.common.APIFramework;
 import edu.uci.ics.asterix.api.common.APIFramework.DisplayFormat;
 import edu.uci.ics.asterix.api.common.Job;
 import edu.uci.ics.asterix.api.common.SessionConfig;
 import edu.uci.ics.asterix.aql.base.Statement;
+import edu.uci.ics.asterix.aql.base.Statement.Kind;
 import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
 import edu.uci.ics.asterix.aql.expression.ControlFeedStatement;
 import edu.uci.ics.asterix.aql.expression.CreateDataverseStatement;
@@ -64,6 +68,7 @@
 import edu.uci.ics.asterix.file.FeedOperations;
 import edu.uci.ics.asterix.file.IndexOperations;
 import edu.uci.ics.asterix.formats.base.IDataFormat;
+import edu.uci.ics.asterix.formats.nontagged.AqlResultSerializerFactoryProvider;
 import edu.uci.ics.asterix.metadata.IDatasetDetails;
 import edu.uci.ics.asterix.metadata.MetadataException;
 import edu.uci.ics.asterix.metadata.MetadataManager;
@@ -81,6 +86,8 @@
 import edu.uci.ics.asterix.om.types.ATypeTag;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.asterix.om.types.TypeSignature;
+import edu.uci.ics.asterix.result.ResultUtils;
+import edu.uci.ics.asterix.result.ResultReader;
 import edu.uci.ics.asterix.transaction.management.exception.ACIDException;
 import edu.uci.ics.asterix.transaction.management.service.transaction.TransactionIDFactory;
 import edu.uci.ics.asterix.translator.AbstractAqlTranslator;
@@ -99,8 +106,10 @@
 import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
 import edu.uci.ics.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
 import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
+import edu.uci.ics.hyracks.algebricks.data.IResultSerializerFactoryProvider;
 import edu.uci.ics.hyracks.algebricks.runtime.writers.PrinterBasedWriterFactory;
 import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
 import edu.uci.ics.hyracks.api.io.FileReference;
 import edu.uci.ics.hyracks.api.job.JobId;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
@@ -140,18 +149,20 @@
 
     /**
      * Compiles and submits for execution a list of AQL statements.
-     * 
+     *
      * @param hcc
-     *            AHyracks client connection that is used to submit a jobspec to
-     *            Hyracks.
-     * @return A List<QueryResult> containing a QueryResult instance
-     *         corresponding to each submitted query.
+     *            A Hyracks client connection that is used to submit a jobspec to Hyracks.
+     * @param asyncResults
+     *            True if the results should be read asynchronously or false if we should wait for results to be read.
+     * @return A List<QueryResult> containing a QueryResult instance corresponding to each submitted query.
      * @throws Exception
      */
-    public List<QueryResult> compileAndExecute(IHyracksClientConnection hcc) throws Exception {
+    public List<QueryResult> compileAndExecute(IHyracksClientConnection hcc, boolean asyncResults) throws Exception {
+        int resultSetIdCounter = 0;
         List<QueryResult> executionResult = new ArrayList<QueryResult>();
         FileSplit outputFile = null;
         IAWriterFactory writerFactory = PrinterBasedWriterFactory.INSTANCE;
+        IResultSerializerFactoryProvider resultSerializerFactoryProvider = AqlResultSerializerFactoryProvider.INSTANCE;
         Map<String, String> config = new HashMap<String, String>();
         List<JobSpecification> jobsToExecute = new ArrayList<JobSpecification>();
 
@@ -160,6 +171,7 @@
             MetadataTransactionContext mdTxnCtx = MetadataManager.INSTANCE.beginTransaction();
             AqlMetadataProvider metadataProvider = new AqlMetadataProvider(mdTxnCtx, activeDefaultDataverse);
             metadataProvider.setWriterFactory(writerFactory);
+            metadataProvider.setResultSerializerFactoryProvider(resultSerializerFactoryProvider);
             metadataProvider.setOutputFile(outputFile);
             metadataProvider.setConfig(config);
             jobsToExecute.clear();
@@ -252,6 +264,7 @@
                     }
 
                     case QUERY: {
+                        metadataProvider.setResultSetId(new ResultSetId(resultSetIdCounter++));
                         executionResult.add(handleQuery(metadataProvider, (Query) stmt, hcc, jobsToExecute));
                         break;
                     }
@@ -275,7 +288,30 @@
             // Following jobs are run under a separate transaction, that is
             // committed/aborted by the JobEventListener
             for (JobSpecification jobspec : jobsToExecute) {
-                runJob(hcc, jobspec);
+                JobId jobId = runJob(hcc, jobspec);
+                if (stmt.getKind() == Kind.QUERY) {
+                    JSONObject response = new JSONObject();
+
+                    if (asyncResults) {
+                        JSONArray handle = new JSONArray();
+                        handle.put(jobId.getId());
+                        handle.put(metadataProvider.getResultSetId().getId());
+                        response.put("handle", handle);
+                    } else {
+                        ByteBuffer buffer = ByteBuffer.allocate(ResultReader.FRAME_SIZE);
+                        ResultReader resultReader = new ResultReader(hcc);
+                        resultReader.open(jobId, metadataProvider.getResultSetId());
+                        buffer.clear();
+                        JSONArray results = new JSONArray();
+                        while (resultReader.read(buffer) > 0) {
+                            results.put(ResultUtils.getJSONFromBuffer(buffer, resultReader.getFrameTupleAccessor()));
+                            buffer.clear();
+                        }
+                        response.put("results", results);
+                    }
+                    out.write(response.toString());
+                }
+                hcc.waitForCompletion(jobId);
             }
         }
         return executionResult;
@@ -393,7 +429,8 @@
         if (dd.getDatasetType() == DatasetType.INTERNAL || dd.getDatasetType() == DatasetType.FEED) {
             Dataverse dataverse = MetadataManager.INSTANCE.getDataverse(metadataProvider.getMetadataTxnContext(),
                     dataverseName);
-            runJob(hcc, DatasetOperations.createDatasetJobSpec(dataverse, datasetName, metadataProvider));
+            JobId jobId = runJob(hcc, DatasetOperations.createDatasetJobSpec(dataverse, datasetName, metadataProvider));
+            hcc.waitForCompletion(jobId);
         }
     }
 
@@ -431,7 +468,8 @@
                     index.getDatasetName(), index.getKeyFieldNames(), index.getGramLength(), index.getIndexType());
             JobSpecification loadIndexJobSpec = IndexOperations
                     .buildSecondaryIndexLoadingJobSpec(cis, metadataProvider);
-            runJob(hcc, loadIndexJobSpec);
+            JobId jobId = runJob(hcc, loadIndexJobSpec);
+            hcc.waitForCompletion(jobId);
         }
     }
 
@@ -664,9 +702,9 @@
         CompiledWriteFromQueryResultStatement clfrqs = new CompiledWriteFromQueryResultStatement(dataverseName, st1
                 .getDatasetName().getValue(), st1.getQuery(), st1.getVarCounter());
 
-        Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        if (compiled.first != null) {
-            jobsToExecute.add(compiled.first);
+        JobSpecification compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+        if (compiled != null) {
+            jobsToExecute.add(compiled);
         }
     }
 
@@ -678,9 +716,10 @@
                 : activeDefaultDataverse.getDataverseName() : stmtInsert.getDataverseName().getValue();
         CompiledInsertStatement clfrqs = new CompiledInsertStatement(dataverseName, stmtInsert.getDatasetName()
                 .getValue(), stmtInsert.getQuery(), stmtInsert.getVarCounter());
-        Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        if (compiled.first != null) {
-            jobsToExecute.add(compiled.first);
+
+        JobSpecification compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+        if (compiled != null) {
+            jobsToExecute.add(compiled);
         }
     }
 
@@ -693,13 +732,13 @@
         CompiledDeleteStatement clfrqs = new CompiledDeleteStatement(stmtDelete.getVariableExpr(), dataverseName,
                 stmtDelete.getDatasetName().getValue(), stmtDelete.getCondition(), stmtDelete.getDieClause(),
                 stmtDelete.getVarCounter(), metadataProvider);
-        Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
-        if (compiled.first != null) {
-            jobsToExecute.add(compiled.first);
+        JobSpecification compiled = rewriteCompileQuery(metadataProvider, clfrqs.getQuery(), clfrqs);
+        if (compiled != null) {
+            jobsToExecute.add(compiled);
         }
     }
 
-    private Pair<JobSpecification, FileSplit> rewriteCompileQuery(AqlMetadataProvider metadataProvider, Query query,
+    private JobSpecification rewriteCompileQuery(AqlMetadataProvider metadataProvider, Query query,
             ICompiledDmlStatement stmt) throws AsterixException, RemoteException, AlgebricksException, JSONException,
             ACIDException {
 
@@ -715,9 +754,7 @@
         JobSpecification spec = APIFramework.compileQuery(declaredFunctions, metadataProvider, query,
                 reWrittenQuery.second, stmt == null ? null : stmt.getDatasetName(), sessionConfig, out, pdf, stmt);
 
-        Pair<JobSpecification, FileSplit> compiled = new Pair<JobSpecification, FileSplit>(spec,
-                metadataProvider.getOutputFile());
-        return compiled;
+        return spec;
 
     }
 
@@ -741,9 +778,10 @@
         }
         bfs.initialize(metadataProvider.getMetadataTxnContext(), dataset);
         cbfs.setQuery(bfs.getQuery());
-        Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, bfs.getQuery(), cbfs);
-        if (compiled.first != null) {
-            jobsToExecute.add(compiled.first);
+
+        JobSpecification compiled = rewriteCompileQuery(metadataProvider, bfs.getQuery(), cbfs);
+        if (compiled != null) {
+            jobsToExecute.add(compiled);
         }
     }
 
@@ -759,12 +797,13 @@
 
     private QueryResult handleQuery(AqlMetadataProvider metadataProvider, Query query, IHyracksClientConnection hcc,
             List<JobSpecification> jobsToExecute) throws Exception {
-        Pair<JobSpecification, FileSplit> compiled = rewriteCompileQuery(metadataProvider, query, null);
-        if (compiled.first != null) {
-            GlobalConfig.ASTERIX_LOGGER.info(compiled.first.toJSON().toString(1));
-            jobsToExecute.add(compiled.first);
+        JobSpecification compiled = rewriteCompileQuery(metadataProvider, query, null);
+        if (compiled != null) {
+            GlobalConfig.ASTERIX_LOGGER.info(compiled.toJSON().toString(1));
+            jobsToExecute.add(compiled);
         }
-        return new QueryResult(query, compiled.second.getLocalFile().getFile().getAbsolutePath());
+
+        return new QueryResult(query, metadataProvider.getResultSetId());
     }
 
     private void runCreateIndexJob(IHyracksClientConnection hcc, CreateIndexStatement stmtCreateIndex,
@@ -783,7 +822,8 @@
             throw new AsterixException("Failed to create job spec for creating index '"
                     + stmtCreateIndex.getDatasetName() + "." + stmtCreateIndex.getIndexName() + "'");
         }
-        runJob(hcc, spec);
+        JobId jobId = runJob(hcc, spec);
+        hcc.waitForCompletion(jobId);
     }
 
     private void handleCreateNodeGroupStatement(AqlMetadataProvider metadataProvider, Statement stmt,
@@ -806,14 +846,16 @@
         }
     }
 
-    private void runJob(IHyracksClientConnection hcc, JobSpecification spec) throws Exception {
-        executeJobArray(hcc, new Job[] { new Job(spec) }, out, pdf);
+    private JobId runJob(IHyracksClientConnection hcc, JobSpecification spec) throws Exception {
+        JobId[] jobIds = executeJobArray(hcc, new Job[] { new Job(spec) }, out, pdf);
+        return jobIds[0];
     }
 
     private void compileIndexDropStatement(IHyracksClientConnection hcc, String dataverseName, String datasetName,
             String indexName, AqlMetadataProvider metadataProvider) throws Exception {
         CompiledIndexDropStatement cds = new CompiledIndexDropStatement(dataverseName, datasetName, indexName);
-        runJob(hcc, IndexOperations.buildDropSecondaryIndexJobSpec(cds, metadataProvider));
+        JobId jobId = runJob(hcc, IndexOperations.buildDropSecondaryIndexJobSpec(cds, metadataProvider));
+        hcc.waitForCompletion(jobId);
         MetadataManager.INSTANCE.dropIndex(metadataProvider.getMetadataTxnContext(), dataverseName, datasetName,
                 indexName);
     }
@@ -825,20 +867,24 @@
         Dataset ds = MetadataManager.INSTANCE.getDataset(mdTxnCtx, dataverseName, datasetName);
         if (ds.getDatasetType() == DatasetType.INTERNAL || ds.getDatasetType() == DatasetType.FEED) {
             JobSpecification[] jobSpecs = DatasetOperations.createDropDatasetJobSpec(cds, metadataProvider);
-            for (JobSpecification spec : jobSpecs)
-                runJob(hcc, spec);
+            for (JobSpecification spec : jobSpecs) {
+                JobId jobId = runJob(hcc, spec);
+                hcc.waitForCompletion(jobId);
+            }
         }
         MetadataManager.INSTANCE.dropDataset(mdTxnCtx, dataverseName, datasetName);
     }
 
-    public void executeJobArray(IHyracksClientConnection hcc, Job[] jobs, PrintWriter out, DisplayFormat pdf)
+    public JobId[] executeJobArray(IHyracksClientConnection hcc, Job[] jobs, PrintWriter out, DisplayFormat pdf)
             throws Exception {
+        JobId[] startedJobIds = new JobId[jobs.length];
         for (int i = 0; i < jobs.length; i++) {
             JobSpecification spec = jobs[i].getJobSpec();
             spec.setMaxReattempts(0);
             JobId jobId = hcc.startJob(GlobalConfig.HYRACKS_APP_NAME, spec);
-            hcc.waitForCompletion(jobId);
+            startedJobIds[i] = jobId;
         }
+        return startedJobIds;
     }
 
     private static IDataFormat getDataFormat(MetadataTransactionContext mdTxnCtx, String dataverseName)
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java
index 0b4a2cf..8d6b35e 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/aql/translator/QueryResult.java
@@ -16,23 +16,35 @@
 
 import edu.uci.ics.asterix.aql.base.Statement;
 import edu.uci.ics.asterix.aql.expression.Query;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
+import edu.uci.ics.hyracks.api.job.JobId;
 
 public class QueryResult {
 
     private final Query query;
-    private final String resultPath;
 
-    public QueryResult(Query statement, String resultPath) {
+    private final ResultSetId resultSetId;
+
+    private JobId jobId;
+
+    public QueryResult(Query statement, ResultSetId resultSetId) {
         this.query = statement;
-        this.resultPath = resultPath;
+        this.resultSetId = resultSetId;
+    }
+
+    public void setJobId(JobId jobId) {
+        this.jobId = jobId;
+    }
+
+    public JobId getJobId() {
+        return jobId;
     }
 
     public Statement getStatement() {
         return query;
     }
 
-    public String getResultPath() {
-        return resultPath;
+    public ResultSetId getResultSetId() {
+        return resultSetId;
     }
-
 }
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
index 9b29427..0c25e34 100644
--- a/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/hyracks/bootstrap/CCBootstrapImpl.java
@@ -23,6 +23,11 @@
 
 import edu.uci.ics.asterix.api.http.servlet.APIServlet;
 import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
+import edu.uci.ics.asterix.api.http.servlet.DDLAPIServlet;
+import edu.uci.ics.asterix.api.http.servlet.QueryAPIServlet;
+import edu.uci.ics.asterix.api.http.servlet.QueryResultAPIServlet;
+import edu.uci.ics.asterix.api.http.servlet.QueryStatusAPIServlet;
+import edu.uci.ics.asterix.api.http.servlet.UpdateAPIServlet;
 import edu.uci.ics.asterix.common.config.GlobalConfig;
 import edu.uci.ics.asterix.metadata.MetadataManager;
 import edu.uci.ics.asterix.metadata.api.IAsterixStateProxy;
@@ -40,7 +45,10 @@
 
     private static final int DEFAULT_WEB_SERVER_PORT = 19001;
 
+    private static final int DEFAULT_JSON_API_SERVER_PORT = 19101;
+
     private Server webServer;
+    private Server jsonAPIServer;
     private static IAsterixStateProxy proxy;
     private ICCApplicationContext appCtx;
 
@@ -59,6 +67,10 @@
         setupWebServer();
         webServer.start();
 
+        // Setup and start the web interface
+        setupJSONAPIServer();
+        jsonAPIServer.start();
+
         AsterixAppContextInfoImpl.initialize(appCtx);
     }
 
@@ -90,4 +102,22 @@
         webServer.setHandler(context);
         context.addServlet(new ServletHolder(new APIServlet()), "/*");
     }
-}
\ No newline at end of file
+
+    private void setupJSONAPIServer() throws Exception {
+        String portStr = System.getProperty(GlobalConfig.JSON_API_SERVER_PORT_PROPERTY);
+        int port = DEFAULT_JSON_API_SERVER_PORT;
+        if (portStr != null) {
+            port = Integer.parseInt(portStr);
+        }
+        jsonAPIServer = new Server(port);
+
+        ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
+        context.setContextPath("/");
+        jsonAPIServer.setHandler(context);
+        context.addServlet(new ServletHolder(new QueryAPIServlet()), "/query");
+        context.addServlet(new ServletHolder(new QueryStatusAPIServlet()), "/query/status");
+        context.addServlet(new ServletHolder(new QueryResultAPIServlet()), "/query/result");
+        context.addServlet(new ServletHolder(new UpdateAPIServlet()), "/update");
+        context.addServlet(new ServletHolder(new DDLAPIServlet()), "/ddl");
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultFrameTupleAccessor.java b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultFrameTupleAccessor.java
new file mode 100644
index 0000000..9d4712b0
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultFrameTupleAccessor.java
@@ -0,0 +1,97 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.result;
+
+import java.io.DataInputStream;
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.hyracks.api.comm.FrameHelper;
+import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+
+public class ResultFrameTupleAccessor implements IFrameTupleAccessor {
+
+    private final int frameSize;
+    private ByteBuffer buffer;
+
+    public ResultFrameTupleAccessor(int frameSize) {
+        this.frameSize = frameSize;
+    }
+
+    @Override
+    public void reset(ByteBuffer buffer) {
+        this.buffer = buffer;
+    }
+
+    @Override
+    public ByteBuffer getBuffer() {
+        return buffer;
+    }
+
+    @Override
+    public int getTupleCount() {
+        return buffer.getInt(FrameHelper.getTupleCountOffset(frameSize));
+    }
+
+    @Override
+    public int getTupleStartOffset(int tupleIndex) {
+        return tupleIndex == 0 ? 0 : buffer.getInt(FrameHelper.getTupleCountOffset(frameSize) - 4 * tupleIndex);
+    }
+
+    @Override
+    public int getTupleEndOffset(int tupleIndex) {
+        return buffer.getInt(FrameHelper.getTupleCountOffset(frameSize) - 4 * (tupleIndex + 1));
+    }
+
+    @Override
+    public int getFieldStartOffset(int tupleIndex, int fIdx) {
+        return fIdx == 0 ? 0 : buffer.getInt(getTupleStartOffset(tupleIndex) + (fIdx - 1) * 4);
+    }
+
+    @Override
+    public int getFieldEndOffset(int tupleIndex, int fIdx) {
+        return buffer.getInt(getTupleStartOffset(tupleIndex) + fIdx * 4);
+    }
+
+    @Override
+    public int getFieldLength(int tupleIndex, int fIdx) {
+        return getFieldEndOffset(tupleIndex, fIdx) - getFieldStartOffset(tupleIndex, fIdx);
+    }
+
+    @Override
+    public int getFieldSlotsLength() {
+        return getFieldCount() * 4;
+    }
+
+    public void prettyPrint() {
+        ByteBufferInputStream bbis = new ByteBufferInputStream();
+        DataInputStream dis = new DataInputStream(bbis);
+        int tc = getTupleCount();
+        System.err.println("TC: " + tc);
+        for (int i = 0; i < tc; ++i) {
+            System.err.print(i + ":(" + getTupleStartOffset(i) + ", " + getTupleEndOffset(i) + ")[");
+
+            bbis.setByteBuffer(buffer, getTupleStartOffset(i));
+            System.err.print(dis);
+
+            System.err.println("]");
+        }
+    }
+
+    @Override
+    public int getFieldCount() {
+        return 1;
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultReader.java b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultReader.java
new file mode 100644
index 0000000..a366abd
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultReader.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.result;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import edu.uci.ics.hyracks.api.client.IHyracksClientConnection;
+import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
+import edu.uci.ics.hyracks.api.dataset.DatasetDirectoryRecord.Status;
+import edu.uci.ics.hyracks.api.dataset.IHyracksDataset;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.api.job.JobId;
+import edu.uci.ics.hyracks.client.dataset.DatasetClientContext;
+import edu.uci.ics.hyracks.client.dataset.HyracksDataset;
+
+public class ResultReader {
+    private final DatasetClientContext datasetClientCtx;
+
+    private final IHyracksDataset hyracksDataset;
+
+    private IFrameTupleAccessor frameTupleAccessor;
+
+    // Number of parallel result reader buffers
+    private static final int NUM_READERS = 1;
+
+    // 32K buffer size;
+    public static final int FRAME_SIZE = 32768;
+
+    public ResultReader(IHyracksClientConnection hcc) throws Exception {
+        datasetClientCtx = new DatasetClientContext(FRAME_SIZE);
+        hyracksDataset = new HyracksDataset(hcc, datasetClientCtx, NUM_READERS);
+    }
+
+    public void open(JobId jobId, ResultSetId resultSetId) throws IOException, ClassNotFoundException {
+        hyracksDataset.open(jobId, resultSetId);
+
+        frameTupleAccessor = new ResultFrameTupleAccessor(datasetClientCtx.getFrameSize());
+    }
+
+    public Status getStatus() {
+        return hyracksDataset.getResultStatus();
+    }
+
+    public int read(ByteBuffer buffer) throws HyracksDataException {
+        return hyracksDataset.read(buffer);
+    }
+
+    public IFrameTupleAccessor getFrameTupleAccessor() {
+        return frameTupleAccessor;
+    }
+}
diff --git a/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java
new file mode 100644
index 0000000..e923821
--- /dev/null
+++ b/asterix-app/src/main/java/edu/uci/ics/asterix/result/ResultUtils.java
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.result;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+import edu.uci.ics.hyracks.dataflow.common.comm.util.ByteBufferInputStream;
+
+public class ResultUtils {
+    public static JSONArray getJSONFromBuffer(ByteBuffer buffer, IFrameTupleAccessor fta) throws HyracksDataException {
+        JSONArray resultRecords = new JSONArray();
+        ByteBufferInputStream bbis = new ByteBufferInputStream();
+
+        try {
+            fta.reset(buffer);
+            for (int tIndex = 0; tIndex < fta.getTupleCount(); tIndex++) {
+                int start = fta.getTupleStartOffset(tIndex);
+                int length = fta.getTupleEndOffset(tIndex) - start;
+                bbis.setByteBuffer(buffer, start);
+                byte[] recordBytes = new byte[length];
+                bbis.read(recordBytes, 0, length);
+                resultRecords.put(new String(recordBytes, 0, length));
+            }
+        } finally {
+            try {
+                bbis.close();
+            } catch (IOException e) {
+                throw new HyracksDataException(e);
+            }
+        }
+        return resultRecords;
+    }
+
+    public static JSONObject getErrorResponse(int errorCode, String errorMessage) {
+        JSONObject errorResp = new JSONObject();
+        JSONArray errorArray = new JSONArray();
+        errorArray.put(errorCode);
+        errorArray.put(errorMessage);
+        try {
+            errorResp.put("error-code", errorArray);
+        } catch (JSONException e) {
+            // TODO(madhusudancs): Figure out what to do when JSONException occurs while building the results.
+        }
+        return errorResp;
+    }
+}
diff --git a/asterix-app/src/main/resources/hyracks-deployment.properties b/asterix-app/src/main/resources/hyracks-deployment.properties
index a8a943e..a333d38 100644
--- a/asterix-app/src/main/resources/hyracks-deployment.properties
+++ b/asterix-app/src/main/resources/hyracks-deployment.properties
@@ -1,2 +1,4 @@
 cc.bootstrap.class=edu.uci.ics.asterix.hyracks.bootstrap.CCBootstrapImpl
-nc.bootstrap.class=edu.uci.ics.asterix.hyracks.bootstrap.NCBootstrapImpl
\ No newline at end of file
+nc.bootstrap.class=edu.uci.ics.asterix.hyracks.bootstrap.NCBootstrapImpl
+cc.ip=127.0.0.1
+cc.port=1098
diff --git a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
index bb39f90..91ea627 100644
--- a/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
+++ b/asterix-common/src/main/java/edu/uci/ics/asterix/common/config/GlobalConfig.java
@@ -4,9 +4,9 @@
 
 public class GlobalConfig {
     public static final boolean DEBUG = true;
-    
+
     public static final String ASTERIX_LOGGER_NAME = "edu.uci.ics.asterix";
-    
+
     public static final Logger ASTERIX_LOGGER = Logger.getLogger(ASTERIX_LOGGER_NAME);
 
     public static final String ASTERIX_LOGFILE_PATTERN = "%t/asterix.log";
@@ -19,6 +19,8 @@
 
     public static final String WEB_SERVER_PORT_PROPERTY = "AsterixWebServerPort";
 
+    public static final String JSON_API_SERVER_PORT_PROPERTY = "AsterixJSONAPIServerPort";
+
     public static final String BUFFER_CACHE_PAGE_SIZE_PROPERTY = "BufferCachePageSize";
 
     public static final String BUFFER_CACHE_NUM_PAGES_PROPERTY = "BufferCacheNumPages";
@@ -32,6 +34,6 @@
     public static final String FRAME_SIZE_PROPERTY = "FrameSize";
 
     public static final float DEFAULT_BTREE_FILL_FACTOR = 1.00f;
-    
+
     public static int DEFAULT_INPUT_DATA_COLUMN = 0;
 }
diff --git a/asterix-dist/src/main/scripts/startasterix.sh b/asterix-dist/src/main/scripts/startasterix.sh
index b84834f..f9d6e6c 100644
--- a/asterix-dist/src/main/scripts/startasterix.sh
+++ b/asterix-dist/src/main/scripts/startasterix.sh
@@ -67,8 +67,8 @@
 # start the node controllers
 for ((i=1;i<=$numnc;i++)); do
 	echo "node controller (nc$i) starting..."
-	sh $HYRACKS_SERVER_BIN/hyracksnc -cc-host localhost -cluster-net-ip-address 127.0.0.1 -data-ip-address 127.0.0.1 -node-id "nc$i" \
-		&> $LOG_DIR/nc$i.log &
+	sh $HYRACKS_SERVER_BIN/hyracksnc -cc-host localhost -cluster-net-ip-address 127.0.0.1 -data-ip-address 127.0.0.1 \
+                -result-ip-address 127.0.0.1 -node-id "nc$i" &> $LOG_DIR/nc$i.log &
 
     # avoid socket error
 	sleep .5
diff --git a/asterix-hyracks-glue/pom.xml b/asterix-hyracks-glue/pom.xml
index e28b2af..1a18d1c 100644
--- a/asterix-hyracks-glue/pom.xml
+++ b/asterix-hyracks-glue/pom.xml
@@ -19,7 +19,6 @@
 				<configuration>
 					<source>1.7</source>
 					<target>1.7</target>
-					<fork>true</fork>
 				</configuration>
 			</plugin>
 		</plugins>
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
index 321a73c..7fa3659 100644
--- a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/AqlMetadataProvider.java
@@ -83,14 +83,17 @@
 import edu.uci.ics.hyracks.algebricks.core.jobgen.impl.JobGenHelper;
 import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
 import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+import edu.uci.ics.hyracks.algebricks.data.IResultSerializerFactoryProvider;
 import edu.uci.ics.hyracks.algebricks.runtime.base.IPushRuntimeFactory;
 import edu.uci.ics.hyracks.algebricks.runtime.base.IScalarEvaluatorFactory;
 import edu.uci.ics.hyracks.algebricks.runtime.operators.std.SinkWriterRuntimeFactory;
 import edu.uci.ics.hyracks.api.dataflow.IOperatorDescriptor;
 import edu.uci.ics.hyracks.api.dataflow.value.IBinaryComparatorFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.IResultSerializerFactory;
 import edu.uci.ics.hyracks.api.dataflow.value.ISerializerDeserializer;
 import edu.uci.ics.hyracks.api.dataflow.value.ITypeTraits;
 import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
 import edu.uci.ics.hyracks.api.io.FileReference;
 import edu.uci.ics.hyracks.api.job.JobSpecification;
 import edu.uci.ics.hyracks.dataflow.std.file.ConstantFileSplitProvider;
@@ -98,6 +101,7 @@
 import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
 import edu.uci.ics.hyracks.dataflow.std.file.IFileSplitProvider;
 import edu.uci.ics.hyracks.dataflow.std.file.ITupleParserFactory;
+import edu.uci.ics.hyracks.dataflow.std.result.ResultWriterOperatorDescriptor;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeDataflowHelperFactory;
 import edu.uci.ics.hyracks.storage.am.btree.dataflow.BTreeSearchOperatorDescriptor;
 import edu.uci.ics.hyracks.storage.am.btree.frames.BTreeNSMInteriorFrameFactory;
@@ -120,6 +124,8 @@
     private Map<String, String> config;
     private IAWriterFactory writerFactory;
     private FileSplit outputFile;
+    private ResultSetId resultSetId;
+    private IResultSerializerFactoryProvider resultSerializerFactoryProvider;
     private long jobTxnId;
 
     private final Dataverse defaultDataverse;
@@ -184,6 +190,22 @@
         this.outputFile = outputFile;
     }
 
+    public ResultSetId getResultSetId() {
+        return resultSetId;
+    }
+
+    public void setResultSetId(ResultSetId resultSetId) {
+        this.resultSetId = resultSetId;
+    }
+
+    public void setResultSerializerFactoryProvider(IResultSerializerFactoryProvider rafp) {
+        this.resultSerializerFactoryProvider = rafp;
+    }
+
+    public IResultSerializerFactoryProvider getResultSerializerFactoryProvider() {
+        return resultSerializerFactoryProvider;
+    }
+
     @Override
     public AqlDataSource findDataSource(AqlSourceId id) throws AlgebricksException {
         AqlSourceId aqlId = (AqlSourceId) id;
@@ -542,6 +564,29 @@
     }
 
     @Override
+    public Pair<IOperatorDescriptor, AlgebricksPartitionConstraint> getResultHandleRuntime(IDataSink sink,
+            int[] printColumns, IPrinterFactory[] printerFactories, RecordDescriptor inputDesc, boolean ordered,
+            JobSpecification spec) throws AlgebricksException {
+        ResultSetDataSink rsds = (ResultSetDataSink) sink;
+        ResultSetSinkId rssId = (ResultSetSinkId) rsds.getId();
+        ResultSetId rsId = rssId.getResultSetId();
+        String nodeName = rssId.getResultNodeName();
+
+        ResultWriterOperatorDescriptor resultWriter = null;
+        try {
+            IResultSerializerFactory resultSerializedAppenderFactory = resultSerializerFactoryProvider
+                    .getAqlResultSerializerFactoryProvider(printColumns, printerFactories, getWriterFactory(), inputDesc);
+            resultWriter = new ResultWriterOperatorDescriptor(spec, rsId, ordered, inputDesc,
+                    resultSerializedAppenderFactory);
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+
+        AlgebricksPartitionConstraint apc = new AlgebricksAbsolutePartitionConstraint(new String[] { nodeName });
+        return new Pair<IOperatorDescriptor, AlgebricksPartitionConstraint>(resultWriter, apc);
+    }
+
+    @Override
     public IDataSourceIndex<String, AqlSourceId> findDataSourceIndex(String indexId, AqlSourceId dataSourceId)
             throws AlgebricksException {
         AqlDataSource ads = findDataSource(dataSourceId);
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java
new file mode 100644
index 0000000..53513d2
--- /dev/null
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetDataSink.java
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.metadata.declared;
+
+import edu.uci.ics.hyracks.algebricks.core.algebra.metadata.IDataSink;
+import edu.uci.ics.hyracks.algebricks.core.algebra.properties.IPartitioningProperty;
+
+public class ResultSetDataSink implements IDataSink {
+
+    private ResultSetSinkId id;
+    private Object[] schemaTypes;
+
+    public ResultSetDataSink(ResultSetSinkId id, Object[] schemaTypes) {
+        this.id = id;
+        this.schemaTypes = schemaTypes;
+    }
+
+    @Override
+    public ResultSetSinkId getId() {
+        return id;
+    }
+
+    @Override
+    public Object[] getSchemaTypes() {
+        return schemaTypes;
+    }
+
+    @Override
+    public IPartitioningProperty getPartitioningProperty() {
+        return IPartitioningProperty.UNPARTITIONED;
+    }
+
+}
diff --git a/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java
new file mode 100644
index 0000000..fc5152f
--- /dev/null
+++ b/asterix-metadata/src/main/java/edu/uci/ics/asterix/metadata/declared/ResultSetSinkId.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.metadata.declared;
+
+import edu.uci.ics.hyracks.api.dataset.ResultSetId;
+
+public class ResultSetSinkId {
+
+    private final ResultSetId resultSetId;
+
+    private final String resultNodeName;
+
+    public ResultSetSinkId(ResultSetId resultSetId, String resultNodeName) {
+        this.resultSetId = resultSetId;
+        this.resultNodeName = resultNodeName;
+    }
+
+    @Override
+    public String toString() {
+        return "ResultSetId: " + resultSetId + "@" + resultNodeName;
+    }
+
+    public ResultSetId getResultSetId() {
+        return resultSetId;
+    }
+
+    public String getResultNodeName() {
+        return resultNodeName;
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinter.java
new file mode 100644
index 0000000..0ae242c
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinter.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ABooleanSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ABooleanPrinter implements IPrinter {
+
+    public static final ABooleanPrinter INSTANCE = new ABooleanPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print(ABooleanSerializerDeserializer.getBoolean(b, s + 1));
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinterFactory.java
new file mode 100644
index 0000000..e18072a
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ABooleanPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ABooleanPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ABooleanPrinterFactory INSTANCE = new ABooleanPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ABooleanPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinter.java
new file mode 100644
index 0000000..7799aaf
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinter.java
@@ -0,0 +1,28 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ACirclePrinter implements IPrinter {
+
+    public static final ACirclePrinter INSTANCE = new ACirclePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("{ circle: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(", { point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print(",");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print("]}]}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinterFactory.java
new file mode 100644
index 0000000..e406a23
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ACirclePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ACirclePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ACirclePrinterFactory INSTANCE = new ACirclePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ACirclePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinter.java
new file mode 100644
index 0000000..0486cf1
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinter.java
@@ -0,0 +1,27 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ADatePrinter implements IPrinter {
+
+    private static long CHRONON_OF_DAY = 24 * 60 * 60 * 1000;
+    public static final ADatePrinter INSTANCE = new ADatePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        long chrononTime = AInt32SerializerDeserializer.getInt(b, s + 1) * CHRONON_OF_DAY;
+
+        ps.print("{ date: ");
+        ps.print(chrononTime);
+        ps.print("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinterFactory.java
new file mode 100644
index 0000000..f60a25e
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADatePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ADatePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ADatePrinterFactory INSTANCE = new ADatePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ADatePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinter.java
new file mode 100644
index 0000000..4fc3589
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinter.java
@@ -0,0 +1,26 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ADateTimePrinter implements IPrinter {
+
+    public static final ADateTimePrinter INSTANCE = new ADateTimePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        long chrononTime = AInt64SerializerDeserializer.getLong(b, s + 1);
+
+        ps.print("{ datetime: ");
+        ps.print(chrononTime);
+        ps.print("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinterFactory.java
new file mode 100644
index 0000000..851fb8a
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADateTimePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ADateTimePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ADateTimePrinterFactory INSTANCE = new ADateTimePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ADateTimePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinter.java
new file mode 100644
index 0000000..2b977a5
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinter.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ADoublePrinter implements IPrinter {
+
+    public static final ADoublePrinter INSTANCE = new ADoublePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinterFactory.java
new file mode 100644
index 0000000..1fdb7d7
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADoublePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ADoublePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ADoublePrinterFactory INSTANCE = new ADoublePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ADoublePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java
new file mode 100644
index 0000000..877c00e
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinter.java
@@ -0,0 +1,31 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ADurationPrinter implements IPrinter {
+
+    public static final ADurationPrinter INSTANCE = new ADurationPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        int months = AInt32SerializerDeserializer.getInt(b, s + 1);
+        long milliseconds = AInt64SerializerDeserializer.getLong(b, s + 5);
+
+        ps.print("{ duration: {");
+        ps.print("months: ");
+        ps.print(months);
+        ps.print("millis: ");
+        ps.print(milliseconds);
+        ps.print("}}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinterFactory.java
new file mode 100644
index 0000000..c0b68db
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ADurationPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ADurationPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ADurationPrinterFactory INSTANCE = new ADurationPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ADurationPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinter.java
new file mode 100644
index 0000000..a941043
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinter.java
@@ -0,0 +1,22 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AFloatSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AFloatPrinter implements IPrinter {
+
+    public static final AFloatPrinter INSTANCE = new AFloatPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print(AFloatSerializerDeserializer.getFloat(b, s + 1));
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java
new file mode 100644
index 0000000..5285daa
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AFloatPrinterFactory.java
@@ -0,0 +1,18 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+
+public class AFloatPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AFloatPrinterFactory INSTANCE = new AFloatPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AFloatPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16Printer.java
new file mode 100644
index 0000000..03dfcdc
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16Printer.java
@@ -0,0 +1,25 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AInt16Printer implements IPrinter {
+    public static final AInt16Printer INSTANCE = new AInt16Printer();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        short i = AInt16SerializerDeserializer.getShort(b, s + 1);
+
+        ps.println("{ int16: ");
+        ps.println(i);
+        ps.println("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java
new file mode 100644
index 0000000..c890b19
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt16PrinterFactory.java
@@ -0,0 +1,18 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+
+public class AInt16PrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AInt16PrinterFactory INSTANCE = new AInt16PrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AInt16Printer.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32Printer.java
new file mode 100644
index 0000000..9c3cf42
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32Printer.java
@@ -0,0 +1,26 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AInt32Printer implements IPrinter {
+
+    public static final AInt32Printer INSTANCE = new AInt32Printer();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        int d = AInt32SerializerDeserializer.getInt(b, s + 1);
+
+        ps.println("{ int32: ");
+        ps.println(d);
+        ps.println("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java
new file mode 100644
index 0000000..6026424
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt32PrinterFactory.java
@@ -0,0 +1,18 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+
+public class AInt32PrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AInt32PrinterFactory INSTANCE = new AInt32PrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AInt32Printer.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64Printer.java
new file mode 100644
index 0000000..afb690e
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64Printer.java
@@ -0,0 +1,23 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt64SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AInt64Printer implements IPrinter {
+    public static final AInt64Printer INSTANCE = new AInt64Printer();
+
+    @Override
+    public void init() {
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        long d = AInt64SerializerDeserializer.getLong(b, s + 1);
+        ps.println("{ int64: ");
+        ps.println(d);
+        ps.println("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64PrinterFactory.java
new file mode 100644
index 0000000..e7e59a7
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt64PrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AInt64PrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AInt64PrinterFactory INSTANCE = new AInt64PrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AInt64Printer.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8Printer.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8Printer.java
new file mode 100644
index 0000000..9890b2e
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8Printer.java
@@ -0,0 +1,26 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt8SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AInt8Printer implements IPrinter {
+
+    public static final AInt8Printer INSTANCE = new AInt8Printer();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        byte o = AInt8SerializerDeserializer.getByte(b, s + 1);
+
+        ps.println("{ int8: ");
+        ps.println(o);
+        ps.println("}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java
new file mode 100644
index 0000000..c9b1155
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AInt8PrinterFactory.java
@@ -0,0 +1,18 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+
+public class AInt8PrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AInt8PrinterFactory INSTANCE = new AInt8PrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AInt8Printer.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinter.java
new file mode 100644
index 0000000..c088904
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinter.java
@@ -0,0 +1,31 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ALinePrinter implements IPrinter {
+
+    public static final ALinePrinter INSTANCE = new ALinePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("{ line: ");
+        ps.print(" [{ point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print("]}, { point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
+        ps.print("]}]}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinterFactory.java
new file mode 100644
index 0000000..072bdd0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ALinePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ALinePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ALinePrinterFactory INSTANCE = new ALinePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ALinePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinter.java
new file mode 100644
index 0000000..a80eec6
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinter.java
@@ -0,0 +1,21 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ANullPrinter implements IPrinter {
+
+    public static final ANullPrinter INSTANCE = new ANullPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("null");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java
new file mode 100644
index 0000000..3184260
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullPrinterFactory.java
@@ -0,0 +1,18 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+
+public class ANullPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ANullPrinterFactory INSTANCE = new ANullPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ANullPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullableFieldPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullableFieldPrinterFactory.java
new file mode 100644
index 0000000..e2631b0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ANullableFieldPrinterFactory.java
@@ -0,0 +1,49 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlJSONPrinterFactoryProvider;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.BuiltinType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ANullableFieldPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    private AUnionType unionType;
+
+    public ANullableFieldPrinterFactory(AUnionType unionType) {
+        this.unionType = unionType;
+    }
+
+    @Override
+    public IPrinter createPrinter() {
+        return new IPrinter() {
+            private IPrinter nullPrinter;
+            private IPrinter fieldPrinter;
+
+            @Override
+            public void init() throws AlgebricksException {
+                nullPrinter = (AqlJSONPrinterFactoryProvider.INSTANCE.getPrinterFactory(BuiltinType.ANULL))
+                        .createPrinter();
+                fieldPrinter = (AqlJSONPrinterFactoryProvider.INSTANCE.getPrinterFactory(unionType.getUnionList()
+                        .get(1))).createPrinter();
+            }
+
+            @Override
+            public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+                fieldPrinter.init();
+                if (b[s] == ATypeTag.NULL.serialize())
+                    nullPrinter.print(b, s, l, ps);
+                else
+                    fieldPrinter.print(b, s, l, ps);
+            }
+
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java
new file mode 100644
index 0000000..29c4ee1
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinter.java
@@ -0,0 +1,120 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class AObjectPrinter implements IPrinter {
+
+    public static final AObjectPrinter INSTANCE = new AObjectPrinter();
+
+    private IPrinter recordPrinter = new ARecordPrinterFactory(null).createPrinter();
+    private IPrinter orderedlistPrinter = new AOrderedlistPrinterFactory(null).createPrinter();
+    private IPrinter unorderedListPrinter = new AUnorderedlistPrinterFactory(null).createPrinter();
+
+    @Override
+    public void init() throws AlgebricksException {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(b[s]);
+        switch (typeTag) {
+            case INT8: {
+                AInt8Printer.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case INT16: {
+                AInt16Printer.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case INT32: {
+                AInt32Printer.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case INT64: {
+                AInt64Printer.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case NULL: {
+                ANullPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case BOOLEAN: {
+                ABooleanPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case FLOAT: {
+                AFloatPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case DOUBLE: {
+                ADoublePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case DATE: {
+                ADatePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case TIME: {
+                ATimePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case DATETIME: {
+                ADateTimePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case DURATION: {
+                ADurationPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case POINT: {
+                APointPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case POINT3D: {
+                APoint3DPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case LINE: {
+                ALinePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case POLYGON: {
+                APolygonPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case CIRCLE: {
+                ACirclePrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case STRING: {
+                AStringPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
+            case RECORD: {
+                this.recordPrinter.init();
+                recordPrinter.print(b, s, l, ps);
+                break;
+            }
+            case ORDEREDLIST: {
+                this.orderedlistPrinter.init();
+                orderedlistPrinter.print(b, s, l, ps);
+                break;
+            }
+            case UNORDEREDLIST: {
+                this.unorderedListPrinter.init();
+                unorderedListPrinter.print(b, s, l, ps);
+                break;
+            }
+            default: {
+                throw new NotImplementedException("No printer for type " + typeTag);
+            }
+        }
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinterFactory.java
new file mode 100644
index 0000000..1c2ba77
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AObjectPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AObjectPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AObjectPrinterFactory INSTANCE = new AObjectPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AObjectPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AOrderedlistPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AOrderedlistPrinterFactory.java
new file mode 100644
index 0000000..b95a072
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AOrderedlistPrinterFactory.java
@@ -0,0 +1,55 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.json.APrintVisitor;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AOrderedlistPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    private AOrderedListType orderedlistType;
+
+    public AOrderedlistPrinterFactory(AOrderedListType orderedlistType) {
+        this.orderedlistType = orderedlistType;
+    }
+
+    @Override
+    public IPrinter createPrinter() {
+
+        PointableAllocator allocator = new PointableAllocator();
+        final IAType inputType = orderedlistType == null ? DefaultOpenFieldType
+                .getDefaultOpenFieldType(ATypeTag.ORDEREDLIST) : orderedlistType;
+        final IVisitablePointable listAccessor = allocator.allocateListValue(inputType);
+        final APrintVisitor printVisitor = new APrintVisitor();
+        final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
+
+        return new IPrinter() {
+
+            @Override
+            public void init() throws AlgebricksException {
+                arg.second = inputType.getTypeTag();
+            }
+
+            @Override
+            public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
+                try {
+                    listAccessor.set(b, start, l);
+                    arg.first = ps;
+                    listAccessor.accept(printVisitor, arg);
+                } catch (Exception ioe) {
+                    throw new AlgebricksException(ioe);
+                }
+            }
+        };
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinter.java
new file mode 100644
index 0000000..873ee61
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinter.java
@@ -0,0 +1,28 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class APoint3DPrinter implements IPrinter {
+
+    public static final APoint3DPrinter INSTANCE = new APoint3DPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("{ point3d: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print("]}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinterFactory.java
new file mode 100644
index 0000000..7105ad3
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APoint3DPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class APoint3DPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final APoint3DPrinterFactory INSTANCE = new APoint3DPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return APoint3DPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinter.java
new file mode 100644
index 0000000..aad4758
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinter.java
@@ -0,0 +1,26 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class APointPrinter implements IPrinter {
+
+    public static final APointPrinter INSTANCE = new APointPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("{ point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print("]}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java
new file mode 100644
index 0000000..36a9bf3
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APointPrinterFactory.java
@@ -0,0 +1,17 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+
+public class APointPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final APointPrinterFactory INSTANCE = new APointPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return APointPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinter.java
new file mode 100644
index 0000000..23eef9d
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinter.java
@@ -0,0 +1,42 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt16SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class APolygonPrinter implements IPrinter {
+
+    public static final APolygonPrinter INSTANCE = new APolygonPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        short numberOfPoints = AInt16SerializerDeserializer.getShort(b, s + 1);
+        s += 3;
+
+        ps.print("{ polygon: [");
+
+        for (int i = 0; i < numberOfPoints; i++) {
+            if (i > 0)
+                ps.print(",");
+
+            ps.print("{ point: [");
+            ps.print(ADoubleSerializerDeserializer.getDouble(b, s));
+            ps.print(",");
+            ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 8));
+            ps.print("]}");
+
+            s += 16;
+        }
+
+        ps.print("]}");
+
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinterFactory.java
new file mode 100644
index 0000000..74c54d0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/APolygonPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class APolygonPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final APolygonPrinterFactory INSTANCE = new APolygonPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return APolygonPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARecordPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARecordPrinterFactory.java
new file mode 100644
index 0000000..ca0597c
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARecordPrinterFactory.java
@@ -0,0 +1,55 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.json.APrintVisitor;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ARecordPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    private final ARecordType recType;
+
+    public ARecordPrinterFactory(ARecordType recType) {
+        this.recType = recType;
+    }
+
+    @Override
+    public IPrinter createPrinter() {
+
+        PointableAllocator allocator = new PointableAllocator();
+        final IAType inputType = recType == null ? DefaultOpenFieldType.getDefaultOpenFieldType(ATypeTag.RECORD)
+                : recType;
+        final IVisitablePointable recAccessor = allocator.allocateRecordValue(inputType);
+        final APrintVisitor printVisitor = new APrintVisitor();
+        final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
+
+        return new IPrinter() {
+
+            @Override
+            public void init() throws AlgebricksException {
+                arg.second = inputType.getTypeTag();
+            }
+
+            @Override
+            public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
+                try {
+                    recAccessor.set(b, start, l);
+                    arg.first = ps;
+                    recAccessor.accept(printVisitor, arg);
+                } catch (Exception ioe) {
+                    throw new AlgebricksException(ioe);
+                }
+            }
+        };
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinter.java
new file mode 100644
index 0000000..e54b73b
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinter.java
@@ -0,0 +1,31 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.ADoubleSerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ARectanglePrinter implements IPrinter {
+
+    public static final ARectanglePrinter INSTANCE = new ARectanglePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        ps.print("{ rectangle: [");
+        ps.print("{ point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
+        ps.print("]}, { point: [");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
+        ps.print(", ");
+        ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
+        ps.print("]}]}");
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinterFactory.java
new file mode 100644
index 0000000..51f6f21
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ARectanglePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ARectanglePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ARectanglePrinterFactory INSTANCE = new ARectanglePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ARectanglePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinter.java
new file mode 100644
index 0000000..c7828fc
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinter.java
@@ -0,0 +1,27 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.utils.WriteValueTools;
+
+public class AStringPrinter implements IPrinter {
+
+    public static final AStringPrinter INSTANCE = new AStringPrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        try {
+            WriteValueTools.writeUTF8String(b, s + 1, l - 1, ps);
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinterFactory.java
new file mode 100644
index 0000000..9d76f35
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AStringPrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AStringPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final AStringPrinterFactory INSTANCE = new AStringPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AStringPrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinter.java
new file mode 100644
index 0000000..53fad9f
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinter.java
@@ -0,0 +1,27 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.serde.AInt32SerializerDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+
+public class ATimePrinter implements IPrinter {
+
+    public static final ATimePrinter INSTANCE = new ATimePrinter();
+
+    @Override
+    public void init() {
+
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        int time = AInt32SerializerDeserializer.getInt(b, s + 1);
+
+        ps.print("{ time: ");
+        ps.print(time);
+        ps.print("}");
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinterFactory.java
new file mode 100644
index 0000000..8f05c69
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/ATimePrinterFactory.java
@@ -0,0 +1,16 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class ATimePrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    public static final ATimePrinterFactory INSTANCE = new ATimePrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return ATimePrinter.INSTANCE;
+    }
+
+}
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java
new file mode 100644
index 0000000..393ad63
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnionPrinterFactory.java
@@ -0,0 +1,58 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+import java.util.List;
+
+import edu.uci.ics.asterix.formats.nontagged.AqlJSONPrinterFactoryProvider;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AUnionPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    private AUnionType unionType;
+
+    public AUnionPrinterFactory(AUnionType unionType) {
+        this.unionType = unionType;
+    }
+
+    @Override
+    public IPrinter createPrinter() {
+
+        return new IPrinter() {
+
+            private IPrinter[] printers;
+            private List<IAType> unionList;
+
+            @Override
+            public void init() throws AlgebricksException {
+                unionList = unionType.getUnionList();
+                printers = new IPrinter[unionType.getUnionList().size()];
+                for (int i = 0; i < printers.length; i++) {
+                    printers[i] = (AqlJSONPrinterFactoryProvider.INSTANCE
+                            .getPrinterFactory(unionType.getUnionList().get(i))).createPrinter();
+                    printers[i].init();
+                }
+            }
+
+            @Override
+            public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+                ATypeTag tag = unionList.get(b[s + 1]).getTypeTag();
+                if (tag == ATypeTag.UNION)
+                    printers[b[s + 1]].print(b, s + 1, l, ps);
+                else {
+                    if (tag == ATypeTag.ANY)
+                        printers[b[s + 1]].print(b, s + 2, l, ps);
+                    else
+                        printers[b[s + 1]].print(b, s + 1, l, ps);
+                }
+            }
+        };
+    }
+
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnorderedlistPrinterFactory.java b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnorderedlistPrinterFactory.java
new file mode 100644
index 0000000..9e1bdda
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/dataflow/data/nontagged/printers/json/AUnorderedlistPrinterFactory.java
@@ -0,0 +1,55 @@
+package edu.uci.ics.asterix.dataflow.data.nontagged.printers.json;
+
+import java.io.PrintStream;
+
+import edu.uci.ics.asterix.om.pointables.PointableAllocator;
+import edu.uci.ics.asterix.om.pointables.base.DefaultOpenFieldType;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.printer.json.APrintVisitor;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+import edu.uci.ics.hyracks.algebricks.data.IPrinter;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+
+public class AUnorderedlistPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+    private AUnorderedListType unorderedlistType;
+
+    public AUnorderedlistPrinterFactory(AUnorderedListType unorderedlistType) {
+        this.unorderedlistType = unorderedlistType;
+    }
+
+    @Override
+    public IPrinter createPrinter() {
+
+        PointableAllocator allocator = new PointableAllocator();
+        final IAType inputType = unorderedlistType == null ? DefaultOpenFieldType
+                .getDefaultOpenFieldType(ATypeTag.UNORDEREDLIST) : unorderedlistType;
+        final IVisitablePointable listAccessor = allocator.allocateListValue(inputType);
+        final APrintVisitor printVisitor = new APrintVisitor();
+        final Pair<PrintStream, ATypeTag> arg = new Pair<PrintStream, ATypeTag>(null, null);
+
+        return new IPrinter() {
+
+            @Override
+            public void init() throws AlgebricksException {
+                arg.second = inputType.getTypeTag();
+            }
+
+            @Override
+            public void print(byte[] b, int start, int l, PrintStream ps) throws AlgebricksException {
+                try {
+                    listAccessor.set(b, start, l);
+                    arg.first = ps;
+                    listAccessor.accept(printVisitor, arg);
+                } catch (Exception ioe) {
+                    throw new AlgebricksException(ioe);
+                }
+            }
+        };
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
index 813c3a0..11f65dc 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/base/IDataFormat.java
@@ -41,6 +41,8 @@
 
     public IPrinterFactoryProvider getPrinterFactoryProvider();
 
+    public IPrinterFactoryProvider getJSONPrinterFactoryProvider();
+
     public INullWriterFactory getNullWriterFactory();
 
     public Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType> partitioningEvaluatorFactory(
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java
new file mode 100644
index 0000000..b8c6ab0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlJSONPrinterFactoryProvider.java
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.formats.nontagged;
+
+
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ABooleanPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ACirclePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADatePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADateTimePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADoublePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADurationPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AFloatPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt16PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt32PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt64PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt8PrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ALinePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ANullPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ANullableFieldPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AObjectPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AOrderedlistPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APoint3DPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APointPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APolygonPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ARecordPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ARectanglePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AStringPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ATimePrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AUnionPrinterFactory;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AUnorderedlistPrinterFactory;
+import edu.uci.ics.asterix.om.types.AOrderedListType;
+import edu.uci.ics.asterix.om.types.ARecordType;
+import edu.uci.ics.asterix.om.types.AUnionType;
+import edu.uci.ics.asterix.om.types.AUnorderedListType;
+import edu.uci.ics.asterix.om.types.IAType;
+import edu.uci.ics.asterix.om.util.NonTaggedFormatUtil;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactoryProvider;
+
+public class AqlJSONPrinterFactoryProvider implements IPrinterFactoryProvider {
+
+    public static final AqlJSONPrinterFactoryProvider INSTANCE = new AqlJSONPrinterFactoryProvider();
+
+    private AqlJSONPrinterFactoryProvider() {
+    }
+
+    @Override
+    public IPrinterFactory getPrinterFactory(Object type) throws AlgebricksException {
+        IAType aqlType = (IAType) type;
+
+        if (aqlType != null) {
+            switch (aqlType.getTypeTag()) {
+                // case ANYTYPE:
+                // return AAnyTypePrinterFactory.INSTANCE;
+                case INT8:
+                    return AInt8PrinterFactory.INSTANCE;
+                case INT16:
+                    return AInt16PrinterFactory.INSTANCE;
+                case INT32:
+                    return AInt32PrinterFactory.INSTANCE;
+                case INT64:
+                    return AInt64PrinterFactory.INSTANCE;
+                case NULL:
+                    return ANullPrinterFactory.INSTANCE;
+                case BOOLEAN:
+                    return ABooleanPrinterFactory.INSTANCE;
+                case FLOAT:
+                    return AFloatPrinterFactory.INSTANCE;
+                case DOUBLE:
+                    return ADoublePrinterFactory.INSTANCE;
+                case TIME:
+                    return ATimePrinterFactory.INSTANCE;
+                case DATE:
+                    return ADatePrinterFactory.INSTANCE;
+                case DATETIME:
+                    return ADateTimePrinterFactory.INSTANCE;
+                case DURATION:
+                    return ADurationPrinterFactory.INSTANCE;
+                case POINT:
+                    return APointPrinterFactory.INSTANCE;
+                case POINT3D:
+                    return APoint3DPrinterFactory.INSTANCE;
+                case LINE:
+                    return ALinePrinterFactory.INSTANCE;
+                case POLYGON:
+                    return APolygonPrinterFactory.INSTANCE;
+                case CIRCLE:
+                    return ACirclePrinterFactory.INSTANCE;
+                case RECTANGLE:
+                    return ARectanglePrinterFactory.INSTANCE;
+                case STRING:
+                    return AStringPrinterFactory.INSTANCE;
+                case RECORD:
+                    return new ARecordPrinterFactory((ARecordType) aqlType);
+                case ORDEREDLIST:
+                    return new AOrderedlistPrinterFactory((AOrderedListType) aqlType);
+                case UNORDEREDLIST:
+                    return new AUnorderedlistPrinterFactory((AUnorderedListType) aqlType);
+                case UNION: {
+                    if (NonTaggedFormatUtil.isOptionalField((AUnionType) aqlType))
+                        return new ANullableFieldPrinterFactory((AUnionType) aqlType);
+                    else
+                        return new AUnionPrinterFactory((AUnionType) aqlType);
+                }
+            }
+        }
+        return AObjectPrinterFactory.INSTANCE;
+
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlResultSerializerFactoryProvider.java b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlResultSerializerFactoryProvider.java
new file mode 100644
index 0000000..4be608a
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/formats/nontagged/AqlResultSerializerFactoryProvider.java
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package edu.uci.ics.asterix.formats.nontagged;
+
+import java.io.PrintStream;
+import java.nio.BufferOverflowException;
+
+import edu.uci.ics.hyracks.algebricks.common.exceptions.AlgebricksException;
+import edu.uci.ics.hyracks.algebricks.data.IAWriter;
+import edu.uci.ics.hyracks.algebricks.data.IAWriterFactory;
+import edu.uci.ics.hyracks.algebricks.data.IPrinterFactory;
+import edu.uci.ics.hyracks.algebricks.data.IResultSerializerFactoryProvider;
+import edu.uci.ics.hyracks.api.comm.IFrameTupleAccessor;
+import edu.uci.ics.hyracks.api.dataflow.value.IResultSerializer;
+import edu.uci.ics.hyracks.api.dataflow.value.IResultSerializerFactory;
+import edu.uci.ics.hyracks.api.dataflow.value.RecordDescriptor;
+import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
+
+public class AqlResultSerializerFactoryProvider implements IResultSerializerFactoryProvider {
+    private static final long serialVersionUID = 1L;
+
+    public static final AqlResultSerializerFactoryProvider INSTANCE = new AqlResultSerializerFactoryProvider();
+
+    private AqlResultSerializerFactoryProvider() {
+    }
+
+    @Override
+    public IResultSerializerFactory getAqlResultSerializerFactoryProvider(final int[] fields,
+            final IPrinterFactory[] printerFactories, final IAWriterFactory writerFactory,
+            final RecordDescriptor inputRecordDesc) {
+        return new IResultSerializerFactory() {
+            private static final long serialVersionUID = 1L;
+
+            @Override
+            public IResultSerializer createResultSerializer(PrintStream printStream) {
+                final IAWriter writer = writerFactory.createWriter(fields, printStream, printerFactories,
+                        inputRecordDesc);
+
+                return new IResultSerializer() {
+                    private static final long serialVersionUID = 1L;
+
+                    @Override
+                    public void init() throws HyracksDataException {
+                        try {
+                            writer.init();
+                        } catch (AlgebricksException e) {
+                            throw new HyracksDataException(e);
+                        }
+                    }
+
+                    @Override
+                    public boolean appendTuple(IFrameTupleAccessor tAccess, int tIdx) throws HyracksDataException {
+                        try {
+                            writer.printTuple(tAccess, tIdx);
+                        } catch (BufferOverflowException e) {
+                            return false;
+                        } catch (AlgebricksException e) {
+                            throw new HyracksDataException(e);
+                        }
+                        return true;
+                    }
+                };
+            }
+        };
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
index db9ac03..47e23fc 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABinary.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -74,4 +77,13 @@
     public String toString() {
         return "ABinary";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ABinary", bytes);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
index 4178b5a..a27b05e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABitArray.java
@@ -14,6 +14,10 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -129,4 +133,17 @@
         sb.append(" ]");
         return sb.toString();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONArray bitArray = new JSONArray();
+        for (int i = 0; i < intArray.length; i++) {
+            bitArray.put(intArray[i]);
+        }
+        json.put("ABitArray", bitArray);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
index 11b223a..85c35b6 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ABoolean.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -71,4 +74,13 @@
     public int hash() {
         return bVal.hashCode();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ABoolean", bVal);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
index 767f172..c7d946c 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ACircle.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -73,4 +76,16 @@
     public String toString() {
         return "ACircle: { center: " + center + ", radius: " + radius + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject circle = new JSONObject();
+        circle.put("center", center);
+        circle.put("radius", radius);
+        json.put("ACircle", circle);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
index 097b736..0ef170e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADate.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -82,4 +85,13 @@
     public int getChrononTimeInDays() {
         return chrononTimeInDay;
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ADate", chrononTimeInDay);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
index e72fd8f..081fa63 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADateTime.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -113,4 +116,12 @@
         return chrononTime;
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ADateTime", chrononTime);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
index 816b8be..582e192 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADouble.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -70,4 +73,12 @@
         return hashCode();
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ADouble", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
index 13f4a05..113751f 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ADuration.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -109,4 +112,15 @@
         return sbder.toString();
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject duration = new JSONObject();
+        duration.put("months", chrononInMonth);
+        duration.put("milliseconds", chrononInMillisecond);
+        json.put("ADuration", duration);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
index a66e198..9804eb3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AFloat.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -69,4 +72,13 @@
     public String toString() {
         return "AFloat: {" + value + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AFloat", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
index bd27f20..2be714d 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt16.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -59,4 +62,13 @@
     public String toString() {
         return "AInt16: {" + value + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AInt16", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
index b656a57..640bc0e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt32.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -84,4 +87,13 @@
     public int hash() {
         return hashCode();
     }
-}
\ No newline at end of file
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AInt32", value);
+
+        return json;
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
index 193a4af..769d492 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt64.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -58,4 +61,13 @@
     public String toString() {
         return "AInt64: {" + value + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AInt64", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
index 87e5472..90135a3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AInt8.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -58,4 +61,13 @@
     public String toString() {
         return "AInt8: {" + value + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AInt8", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
index 0285825..dc420ed 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ALine.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -66,4 +69,16 @@
     public String toString() {
         return "ALine: { p1: " + p1 + ", p2: " + p2 + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject line = new JSONObject();
+        line.put("p1", p1);
+        line.put("p2", p2);
+        json.put("ALine", line);
+
+        return json;
+    }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
index be47b41..baaa00a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ANull.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -52,4 +55,13 @@
     public String toString() {
         return "null";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ANull", "null");
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
index 4f5effd..36a92f3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AOrderedList.java
@@ -16,6 +16,10 @@
 
 import java.util.ArrayList;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.AOrderedListType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -107,4 +111,17 @@
         sb.append(" ]");
         return sb.toString();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONArray list = new JSONArray();
+        for (IAObject v : values) {
+            list.put(v.toJSON());
+        }
+        json.put("AOrderedList", list);
+
+        return json;
+    }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
index 8e261a2..8bb44eb 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -66,4 +69,16 @@
     public String toString() {
         return "APoint: { x: " + x + ", y: " + y + " }";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject point = new JSONObject();
+        point.put("x", x);
+        point.put("y", y);
+        json.put("APoint", point);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
index 29ef6cd..d15139a 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APoint3D.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -72,4 +75,17 @@
     public String toString() {
         return "APoint3D: { x: " + x + ", y: " + y + ", z: " + z + " }";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject point = new JSONObject();
+        point.put("x", x);
+        point.put("y", y);
+        point.put("z", z);
+        json.put("APoint3D", point);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
index 29e3727..ed21378 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/APolygon.java
@@ -14,6 +14,10 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -85,4 +89,17 @@
         sb.append(" ]");
         return sb.toString();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONArray polygon = new JSONArray();
+        for (int i = 0; i < points.length; i++) {
+            polygon.put(points[i].toJSON());
+        }
+        json.put("APolygon", polygon);
+
+        return json;
+    }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
index 0d1f578..0035289 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARecord.java
@@ -14,6 +14,10 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.ARecordType;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
@@ -87,4 +91,19 @@
         sb.append(" }");
         return sb.toString();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONArray record = new JSONArray();
+        for (int i = 0; i < fields.length; i++) {
+            JSONObject item = new JSONObject();
+            item.put(type.getFieldNames()[i], fields[i]);
+            record.put(item);
+        }
+        json.put("ARecord", record);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
index 51f06bf..d82d351 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ARectangle.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -66,4 +69,16 @@
     public String toString() {
         return "ARectangle: { p1: " + p1 + ", p2: " + p2 + "}";
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONObject rectangle = new JSONObject();
+        rectangle.put("p1", p1);
+        rectangle.put("p2", p2);
+        json.put("ARectangle", rectangle);
+
+        return json;
+    }
 }
\ No newline at end of file
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
index 0f7c9c2..b1f2550 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AString.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.BuiltinType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -67,4 +70,13 @@
     public int hash() {
         return hashCode();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("AString", value);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
index 7b66cf9..b97ed51 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/ATime.java
@@ -14,6 +14,9 @@
  */
 package edu.uci.ics.asterix.om.base;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
 import edu.uci.ics.asterix.om.types.BuiltinType;
@@ -98,4 +101,12 @@
         return chrononTime;
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        json.put("ATime", chrononTime);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
index 764d05b..459ccf5 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/AUnorderedList.java
@@ -16,6 +16,10 @@
 
 import java.util.ArrayList;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.AUnorderedListType;
 import edu.uci.ics.asterix.om.types.IAType;
@@ -107,4 +111,17 @@
         sb.append(" ]");
         return sb.toString();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject json = new JSONObject();
+
+        JSONArray list = new JSONArray();
+        for (IAObject v : values) {
+            list.put(v.toJSON());
+        }
+        json.put("AUnorderedList", list);
+
+        return json;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
index 463154b..bfc0aba 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/base/IAObject.java
@@ -17,11 +17,12 @@
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.types.IAType;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
+import edu.uci.ics.hyracks.api.dataflow.value.JSONSerializable;
 
 /**
  * Represents an object in Asterix.
  */
-public interface IAObject {
+public interface IAObject extends JSONSerializable {
     public IAType getType();
 
     public void accept(IOMVisitor visitor) throws AsterixException;
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java
new file mode 100644
index 0000000..e0b3167
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/AListPrinter.java
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer.json;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is to print the content of a list. It is ONLY visible to
+ * APrintVisitor.
+ */
+class AListPrinter {
+    private static String BEGIN = "{ unorderedlist: [";
+    private static String BEGIN_ORDERED = "{ orderedlist: [";
+    private static String END = " ]}";
+    private static String COMMA = ", ";
+
+    private final Pair<PrintStream, ATypeTag> itemVisitorArg = new Pair<PrintStream, ATypeTag>(null, null);
+    private String begin = BEGIN;
+
+    public AListPrinter(boolean ordered) {
+        if (ordered) {
+            begin = BEGIN_ORDERED;
+        }
+    }
+
+    public void printList(AListPointable listAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+            AsterixException {
+        List<IVisitablePointable> itemTags = listAccessor.getItemTags();
+        List<IVisitablePointable> items = listAccessor.getItems();
+        itemVisitorArg.first = ps;
+
+        // print the beginning part
+        ps.print(begin);
+
+        // print item 0 to n-2
+        for (int i = 0; i < items.size() - 1; i++) {
+            printItem(visitor, itemTags, items, i);
+            // print the comma
+            ps.print(COMMA);
+        }
+
+        // print item n-1
+        if (items.size() > 0) {
+            printItem(visitor, itemTags, items, items.size() - 1);
+        }
+
+        // print the end part
+        ps.print(END);
+    }
+
+    private void printItem(APrintVisitor visitor, List<IVisitablePointable> itemTags, List<IVisitablePointable> items,
+            int i) throws AsterixException {
+        IVisitablePointable itemTypeTag = itemTags.get(i);
+        IVisitablePointable item = items.get(i);
+        ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+                .getStartOffset()]);
+        itemVisitorArg.second = item.getLength() <= 1 ? ATypeTag.NULL : typeTag;
+        item.accept(visitor, itemVisitorArg);
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java
new file mode 100644
index 0000000..b2d5339
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/APrintVisitor.java
@@ -0,0 +1,185 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer.json;
+
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ABooleanPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ACirclePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADatePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADateTimePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADoublePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ADurationPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AFloatPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt16Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt32Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt64Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AInt8Printer;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ALinePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ANullPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APoint3DPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APointPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.APolygonPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ARectanglePrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.AStringPrinter;
+import edu.uci.ics.asterix.dataflow.data.nontagged.printers.json.ATimePrinter;
+import edu.uci.ics.asterix.om.pointables.AFlatValuePointable;
+import edu.uci.ics.asterix.om.pointables.AListPointable;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.pointables.visitor.IVisitablePointableVisitor;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.hyracks.algebricks.common.exceptions.NotImplementedException;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is a IVisitablePointableVisitor implementation which recursively
+ * visit a given record, list or flat value of a given type, and print it to a
+ * PrintStream in adm format.
+ */
+public class APrintVisitor implements IVisitablePointableVisitor<Void, Pair<PrintStream, ATypeTag>> {
+
+    private final Map<IVisitablePointable, ARecordPrinter> raccessorToPrinter = new HashMap<IVisitablePointable, ARecordPrinter>();
+    private final Map<IVisitablePointable, AListPrinter> laccessorToPrinter = new HashMap<IVisitablePointable, AListPrinter>();
+
+    @Override
+    public Void visit(AListPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+        AListPrinter printer = laccessorToPrinter.get(accessor);
+        if (printer == null) {
+            printer = new AListPrinter(accessor.ordered());
+            laccessorToPrinter.put(accessor, printer);
+        }
+        try {
+            printer.printList(accessor, arg.first, this);
+        } catch (Exception e) {
+            throw new AsterixException(e);
+        }
+        return null;
+    }
+
+    @Override
+    public Void visit(ARecordPointable accessor, Pair<PrintStream, ATypeTag> arg) throws AsterixException {
+        ARecordPrinter printer = raccessorToPrinter.get(accessor);
+        if (printer == null) {
+            printer = new ARecordPrinter();
+            raccessorToPrinter.put(accessor, printer);
+        }
+        try {
+            printer.printRecord(accessor, arg.first, this);
+        } catch (Exception e) {
+            throw new AsterixException(e);
+        }
+        return null;
+    }
+
+    @Override
+    public Void visit(AFlatValuePointable accessor, Pair<PrintStream, ATypeTag> arg) {
+        try {
+            byte[] b = accessor.getByteArray();
+            int s = accessor.getStartOffset();
+            int l = accessor.getLength();
+            PrintStream ps = arg.first;
+            ATypeTag typeTag = arg.second;
+            switch (typeTag) {
+                case INT8: {
+                    AInt8Printer.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case INT16: {
+                    AInt16Printer.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case INT32: {
+                    AInt32Printer.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case INT64: {
+                    AInt64Printer.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case NULL: {
+                    ANullPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case BOOLEAN: {
+                    ABooleanPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case FLOAT: {
+                    AFloatPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case DOUBLE: {
+                    ADoublePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case DATE: {
+                    ADatePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case TIME: {
+                    ATimePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case DATETIME: {
+                    ADateTimePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case DURATION: {
+                    ADurationPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case POINT: {
+                    APointPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case POINT3D: {
+                    APoint3DPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case LINE: {
+                    ALinePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case POLYGON: {
+                    APolygonPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case CIRCLE: {
+                    ACirclePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case RECTANGLE: {
+                    ARectanglePrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                case STRING: {
+                    AStringPrinter.INSTANCE.print(b, s, l, ps);
+                    break;
+                }
+                default: {
+                    throw new NotImplementedException("No printer for type " + typeTag);
+                }
+            }
+            return null;
+        } catch (Exception e) {
+            throw new IllegalStateException(e);
+        }
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java
new file mode 100644
index 0000000..e15f9c0
--- /dev/null
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/pointables/printer/json/ARecordPrinter.java
@@ -0,0 +1,88 @@
+/*
+ * Copyright 2009-2010 by The Regents of the University of California
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * you may obtain a copy of the License from
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package edu.uci.ics.asterix.om.pointables.printer.json;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.List;
+
+import edu.uci.ics.asterix.common.exceptions.AsterixException;
+import edu.uci.ics.asterix.om.pointables.ARecordPointable;
+import edu.uci.ics.asterix.om.pointables.base.IVisitablePointable;
+import edu.uci.ics.asterix.om.types.ATypeTag;
+import edu.uci.ics.asterix.om.types.EnumDeserializer;
+import edu.uci.ics.hyracks.algebricks.common.utils.Pair;
+
+/**
+ * This class is to print the content of a record. It is ONLY visible to
+ * APrintVisitor.
+ */
+class ARecordPrinter {
+    private static String LEFT_PAREN = "{ ";
+    private static String RIGHT_PAREN = " }";
+    private static String COMMA = ", ";
+    private static String COLON = ": ";
+
+    private final Pair<PrintStream, ATypeTag> nameVisitorArg = new Pair<PrintStream, ATypeTag>(null, ATypeTag.STRING);
+    private final Pair<PrintStream, ATypeTag> itemVisitorArg = new Pair<PrintStream, ATypeTag>(null, null);
+
+    public ARecordPrinter() {
+
+    }
+
+    public void printRecord(ARecordPointable recordAccessor, PrintStream ps, APrintVisitor visitor) throws IOException,
+            AsterixException {
+        List<IVisitablePointable> fieldNames = recordAccessor.getFieldNames();
+        List<IVisitablePointable> fieldTags = recordAccessor.getFieldTypeTags();
+        List<IVisitablePointable> fieldValues = recordAccessor.getFieldValues();
+
+        nameVisitorArg.first = ps;
+        itemVisitorArg.first = ps;
+
+        // print the beginning part
+        ps.print(LEFT_PAREN);
+
+        // print field 0 to n-2
+        for (int i = 0; i < fieldNames.size() - 1; i++) {
+            printField(ps, visitor, fieldNames, fieldTags, fieldValues, i);
+            // print the comma
+            ps.print(COMMA);
+        }
+
+        // print field n-1
+        if (fieldValues.size() > 0) {
+            printField(ps, visitor, fieldNames, fieldTags, fieldValues, fieldValues.size() - 1);
+        }
+
+        // print the end part
+        ps.print(RIGHT_PAREN);
+    }
+
+    private void printField(PrintStream ps, APrintVisitor visitor, List<IVisitablePointable> fieldNames,
+            List<IVisitablePointable> fieldTags, List<IVisitablePointable> fieldValues, int i) throws AsterixException {
+        IVisitablePointable itemTypeTag = fieldTags.get(i);
+        IVisitablePointable item = fieldValues.get(i);
+        ATypeTag typeTag = EnumDeserializer.ATYPETAGDESERIALIZER.deserialize(itemTypeTag.getByteArray()[itemTypeTag
+                .getStartOffset()]);
+        itemVisitorArg.second = item.getLength() <= 1 ? ATypeTag.NULL : typeTag;
+
+        // print field name
+        fieldNames.get(i).accept(visitor, nameVisitorArg);
+        ps.print(COLON);
+        // print field value
+        item.accept(visitor, itemVisitorArg);
+    }
+}
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
index 59423e2..5620e4e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AOrderedListType.java
@@ -1,5 +1,8 @@
 package edu.uci.ics.asterix.om.types;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.om.base.IAObject;
 
 public class AOrderedListType extends AbstractCollectionType {
@@ -52,4 +55,11 @@
     public int hash() {
         return hashCode();
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException{
+        JSONObject type = new JSONObject();
+        type.put("type", itemType);
+        return type;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
index 82320e4..37452b3 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/ARecordType.java
@@ -22,6 +22,10 @@
 import java.util.Arrays;
 import java.util.List;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.annotations.IRecordTypeAnnotation;
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.IAObject;
@@ -270,4 +274,24 @@
         }
         return h;
     }
+
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject type = new JSONObject();
+        if (isOpen) {
+            type.put("open", true);
+        } else {
+            type.put("open", false);
+        }
+
+        JSONArray fields = new JSONArray();
+        for (int i = 0; i < fieldNames.length; i++) {
+            JSONObject field = new JSONObject();
+            field.put(fieldNames[i], fieldTypes[i].toJSON());
+            fields.put(field);
+        }
+
+        type.put("fields", fields);
+        return type;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnionType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnionType.java
index 1e70f15..dc74b6e 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnionType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnionType.java
@@ -4,6 +4,10 @@
 import java.util.Iterator;
 import java.util.List;
 
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
@@ -27,7 +31,7 @@
     }
 
     public boolean isNullableType() {
-    	return unionList.size() == 2 && unionList.get(0).equals(BuiltinType.ANULL);
+        return unionList.size() == 2 && unionList.get(0).equals(BuiltinType.ANULL);
     }
 
     @Override
@@ -100,4 +104,23 @@
         return h;
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException {
+        JSONObject type = new JSONObject();
+        type.put("type", "UNION");
+
+        JSONArray fields = new JSONArray();
+
+        Iterator<IAType> iter = unionList.iterator();
+        if (iter.hasNext()) {
+            IAType t0 = iter.next();
+            fields.put(t0.toJSON());
+            while (iter.hasNext()) {
+                fields.put(iter.next().toJSON());
+            }
+        }
+
+        type.put("fields", fields);
+        return type;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
index c15dc49..a62bd5b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/AUnorderedListType.java
@@ -1,5 +1,8 @@
 package edu.uci.ics.asterix.om.types;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.om.base.IAObject;
 
 public class AUnorderedListType extends AbstractCollectionType {
@@ -53,4 +56,10 @@
         return hashCode();
     }
 
+    @Override
+    public JSONObject toJSON() throws JSONException{
+        JSONObject type = new JSONObject();
+        type.put("type", itemType);
+        return type;
+    }
 }
diff --git a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
index 4d9cd7f..a70f15b 100644
--- a/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
+++ b/asterix-om/src/main/java/edu/uci/ics/asterix/om/types/BuiltinType.java
@@ -1,5 +1,8 @@
 package edu.uci.ics.asterix.om.types;
 
+import org.json.JSONException;
+import org.json.JSONObject;
+
 import edu.uci.ics.asterix.common.exceptions.AsterixException;
 import edu.uci.ics.asterix.om.base.IAObject;
 import edu.uci.ics.asterix.om.visitors.IOMVisitor;
@@ -41,6 +44,13 @@
         public String getConstructor() {
             return null;
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AsterixType");
+            return type;
+        }
     };
 
     public final static BuiltinType AINT8 = new LowerCaseConstructorType() {
@@ -61,6 +71,13 @@
         public String getTypeName() {
             return "int8";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AInt8");
+            return type;
+        }
     };
 
     public final static BuiltinType AINT16 = new LowerCaseConstructorType() {
@@ -81,6 +98,13 @@
         public String getTypeName() {
             return "int16";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AInt16");
+            return type;
+        }
     };
 
     public final static BuiltinType AINT32 = new LowerCaseConstructorType() {
@@ -101,6 +125,13 @@
         public String getTypeName() {
             return "int32";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AInt32");
+            return type;
+        }
     };
 
     public static final BuiltinType AINT64 = new LowerCaseConstructorType() {
@@ -122,6 +153,12 @@
             return "int64";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AInt64");
+            return type;
+        }
     };
 
     public final static BuiltinType ABINARY = new LowerCaseConstructorType() {
@@ -143,6 +180,12 @@
             return "binary";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ABinary");
+            return type;
+        }
     };
 
     public final static BuiltinType AFLOAT = new LowerCaseConstructorType() {
@@ -164,6 +207,12 @@
             return "float";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AFloat");
+            return type;
+        }
     };
 
     public final static BuiltinType ADOUBLE = new LowerCaseConstructorType() {
@@ -184,6 +233,13 @@
         public String getTypeName() {
             return "double";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ADouble");
+            return type;
+        }
     };
 
     public final static BuiltinType ASTRING = new LowerCaseConstructorType() {
@@ -204,6 +260,13 @@
         public String getTypeName() {
             return "string";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "AString");
+            return type;
+        }
     };
 
     public final static BuiltinType ANULL = new LowerCaseConstructorType() {
@@ -225,6 +288,12 @@
             return "null";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "Null");
+            return type;
+        }
     };
 
     public final static BuiltinType ABOOLEAN = new LowerCaseConstructorType() {
@@ -246,6 +315,12 @@
             return "boolean";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ABoolean");
+            return type;
+        }
     };
 
     public final static BuiltinType ATIME = new LowerCaseConstructorType() {
@@ -266,6 +341,13 @@
         public String getTypeName() {
             return "time";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ATime");
+            return type;
+        }
     };
 
     public final static BuiltinType ADATE = new LowerCaseConstructorType() {
@@ -286,6 +368,13 @@
         public String getTypeName() {
             return "date";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ADate");
+            return type;
+        }
     };
 
     public final static BuiltinType ADATETIME = new LowerCaseConstructorType() {
@@ -306,6 +395,13 @@
         public String getTypeName() {
             return "datetime";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ADateTime");
+            return type;
+        }
     };
 
     public final static BuiltinType ADURATION = new LowerCaseConstructorType() {
@@ -327,6 +423,12 @@
             return "duration";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ADuration");
+            return type;
+        }
     };
 
     public final static BuiltinType AINTERVAL = new LowerCaseConstructorType() {
@@ -348,6 +450,10 @@
             return "interval";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            return null;
+        }
     };
 
     public final static BuiltinType APOINT = new LowerCaseConstructorType() {
@@ -368,6 +474,13 @@
         public String getTypeName() {
             return "point";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "APoint");
+            return type;
+        }
     };
 
     public final static BuiltinType APOINT3D = new LowerCaseConstructorType() {
@@ -388,6 +501,13 @@
         public String getTypeName() {
             return "point3d";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "APoint3D");
+            return type;
+        }
     };
 
     public final static BuiltinType ALINE = new LowerCaseConstructorType() {
@@ -409,6 +529,12 @@
             return "line";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ALINE");
+            return type;
+        }
     };
 
     public final static BuiltinType APOLYGON = new LowerCaseConstructorType() {
@@ -430,6 +556,12 @@
             return "polygon";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "APOLYGON");
+            return type;
+        }
     };
 
     public final static BuiltinType ACIRCLE = new LowerCaseConstructorType() {
@@ -451,6 +583,12 @@
             return "circle";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ACIRCLE");
+            return type;
+        }
     };
 
     public final static BuiltinType ARECTANGLE = new LowerCaseConstructorType() {
@@ -472,6 +610,12 @@
             return "rectangle";
         }
 
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ARECTANGLE");
+            return type;
+        }
     };
 
     public static final IAType ABITARRAY = new LowerCaseConstructorType() {
@@ -492,6 +636,13 @@
         public String getTypeName() {
             return "abitarray";
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ABitArray");
+            return type;
+        }
     };
 
     public static final IAType ANY = new BuiltinType() {
@@ -517,6 +668,13 @@
         public String getConstructor() {
             return null;
         }
+
+        @Override
+        public JSONObject toJSON() throws JSONException {
+            JSONObject type = new JSONObject();
+            type.put("type", "ANY");
+            return type;
+        }
     };
 
     public abstract String getConstructor();
@@ -588,4 +746,4 @@
         throw new AsterixException("No string translation for type: " + str + " .");
     }
 
-}
\ No newline at end of file
+}
diff --git a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
index a334893..f12ea91 100644
--- a/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
+++ b/asterix-runtime/src/main/java/edu/uci/ics/asterix/runtime/formats/NonTaggedDataFormat.java
@@ -19,6 +19,7 @@
 import edu.uci.ics.asterix.formats.nontagged.AqlBinaryHashFunctionFactoryProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlBinaryHashFunctionFamilyProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlBinaryIntegerInspector;
+import edu.uci.ics.asterix.formats.nontagged.AqlJSONPrinterFactoryProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlNormalizedKeyComputerFactoryProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlPrinterFactoryProvider;
 import edu.uci.ics.asterix.formats.nontagged.AqlSerializerDeserializerProvider;
@@ -265,51 +266,46 @@
 
 public class NonTaggedDataFormat implements IDataFormat {
 
-	private static boolean registered = false;
+    private static boolean registered = false;
 
-	public static final NonTaggedDataFormat INSTANCE = new NonTaggedDataFormat();
+    public static final NonTaggedDataFormat INSTANCE = new NonTaggedDataFormat();
 
-	private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
+    private static LogicalVariable METADATA_DUMMY_VAR = new LogicalVariable(-1);
 
-	private static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
+    private static final HashMap<ATypeTag, IValueParserFactory> typeToValueParserFactMap = new HashMap<ATypeTag, IValueParserFactory>();
 
-	public static final String NON_TAGGED_DATA_FORMAT = "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat";
+    public static final String NON_TAGGED_DATA_FORMAT = "edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat";
 
-	static {
-		typeToValueParserFactMap.put(ATypeTag.INT32,
-				IntegerParserFactory.INSTANCE);
-		typeToValueParserFactMap.put(ATypeTag.FLOAT,
-				FloatParserFactory.INSTANCE);
-		typeToValueParserFactMap.put(ATypeTag.DOUBLE,
-				DoubleParserFactory.INSTANCE);
-		typeToValueParserFactMap
-				.put(ATypeTag.INT64, LongParserFactory.INSTANCE);
-		typeToValueParserFactMap.put(ATypeTag.STRING,
-				UTF8StringParserFactory.INSTANCE);
-	}
+    static {
+        typeToValueParserFactMap.put(ATypeTag.INT32, IntegerParserFactory.INSTANCE);
+        typeToValueParserFactMap.put(ATypeTag.FLOAT, FloatParserFactory.INSTANCE);
+        typeToValueParserFactMap.put(ATypeTag.DOUBLE, DoubleParserFactory.INSTANCE);
+        typeToValueParserFactMap.put(ATypeTag.INT64, LongParserFactory.INSTANCE);
+        typeToValueParserFactMap.put(ATypeTag.STRING, UTF8StringParserFactory.INSTANCE);
+    }
 
-	public NonTaggedDataFormat() {
-	}
+    public NonTaggedDataFormat() {
+    }
 
-	public void registerRuntimeFunctions() throws AlgebricksException {
+    public void registerRuntimeFunctions() throws AlgebricksException {
 
-		if (registered) {
-			return;
-		}
-		registered = true;
+        if (registered) {
+            return;
+        }
+        registered = true;
 
-		if (FunctionManagerHolder.getFunctionManager() != null) {
-			return;
-		}
+        if (FunctionManagerHolder.getFunctionManager() != null) {
+            return;
+        }
 
-		List<IFunctionDescriptorFactory> temp = new ArrayList<IFunctionDescriptorFactory>();
+        List<IFunctionDescriptorFactory> temp = new ArrayList<IFunctionDescriptorFactory>();
 
-		// format-independent
-		temp.add(ContainsDescriptor.FACTORY);
-		temp.add(EndsWithDescriptor.FACTORY);
-		temp.add(StartsWithDescriptor.FACTORY);
-		temp.add(SubstringDescriptor.FACTORY);
-		temp.add(TidRunningAggregateDescriptor.FACTORY);
+        // format-independent
+        temp.add(ContainsDescriptor.FACTORY);
+        temp.add(EndsWithDescriptor.FACTORY);
+        temp.add(StartsWithDescriptor.FACTORY);
+        temp.add(SubstringDescriptor.FACTORY);
+        temp.add(TidRunningAggregateDescriptor.FACTORY);
 
         // format-dependent
         temp.add(AndDescriptor.FACTORY);
@@ -327,138 +323,138 @@
         temp.add(UnorderedListConstructorDescriptor.FACTORY);
         temp.add(EmbedTypeDescriptor.FACTORY);
 
-		temp.add(NumericAddDescriptor.FACTORY);
-		temp.add(NumericDivideDescriptor.FACTORY);
-		temp.add(NumericMultiplyDescriptor.FACTORY);
-		temp.add(NumericSubtractDescriptor.FACTORY);
-		temp.add(NumericModuloDescriptor.FACTORY);
-		temp.add(IsNullDescriptor.FACTORY);
-		temp.add(NotDescriptor.FACTORY);
-		temp.add(LenDescriptor.FACTORY);
-		temp.add(EmptyStreamAggregateDescriptor.FACTORY);
-		temp.add(NonEmptyStreamAggregateDescriptor.FACTORY);
-		temp.add(RangeDescriptor.FACTORY);
+        temp.add(NumericAddDescriptor.FACTORY);
+        temp.add(NumericDivideDescriptor.FACTORY);
+        temp.add(NumericMultiplyDescriptor.FACTORY);
+        temp.add(NumericSubtractDescriptor.FACTORY);
+        temp.add(NumericModuloDescriptor.FACTORY);
+        temp.add(IsNullDescriptor.FACTORY);
+        temp.add(NotDescriptor.FACTORY);
+        temp.add(LenDescriptor.FACTORY);
+        temp.add(EmptyStreamAggregateDescriptor.FACTORY);
+        temp.add(NonEmptyStreamAggregateDescriptor.FACTORY);
+        temp.add(RangeDescriptor.FACTORY);
 
-		temp.add(NumericAbsDescriptor.FACTORY);
-		temp.add(NumericCeilingDescriptor.FACTORY);
-		temp.add(NumericFloorDescriptor.FACTORY);
-		temp.add(NumericRoundDescriptor.FACTORY);
-		temp.add(NumericRoundHalfToEvenDescriptor.FACTORY);
-		temp.add(NumericRoundHalfToEven2Descriptor.FACTORY);
-		// String functions
-		temp.add(StringEqualDescriptor.FACTORY);
-		temp.add(StringStartWithDescrtiptor.FACTORY);
-		temp.add(StringEndWithDescrtiptor.FACTORY);
-		temp.add(StringMatchesDescriptor.FACTORY);
-		temp.add(StringLowerCaseDescriptor.FACTORY);
-		temp.add(StringMatchesWithFlagDescriptor.FACTORY);
-		temp.add(StringReplaceDescriptor.FACTORY);
-		temp.add(StringReplaceWithFlagsDescriptor.FACTORY);
-		temp.add(StringLengthDescriptor.FACTORY);
-		temp.add(Substring2Descriptor.FACTORY);
-		temp.add(SubstringBeforeDescriptor.FACTORY);
-		temp.add(SubstringAfterDescriptor.FACTORY);
-		temp.add(StringToCodePointDescriptor.FACTORY);
-		temp.add(CodePointToStringDescriptor.FACTORY);
-		temp.add(StringConcatDescriptor.FACTORY);
-		temp.add(StringJoinDescriptor.FACTORY);
+        temp.add(NumericAbsDescriptor.FACTORY);
+        temp.add(NumericCeilingDescriptor.FACTORY);
+        temp.add(NumericFloorDescriptor.FACTORY);
+        temp.add(NumericRoundDescriptor.FACTORY);
+        temp.add(NumericRoundHalfToEvenDescriptor.FACTORY);
+        temp.add(NumericRoundHalfToEven2Descriptor.FACTORY);
+        // String functions
+        temp.add(StringEqualDescriptor.FACTORY);
+        temp.add(StringStartWithDescrtiptor.FACTORY);
+        temp.add(StringEndWithDescrtiptor.FACTORY);
+        temp.add(StringMatchesDescriptor.FACTORY);
+        temp.add(StringLowerCaseDescriptor.FACTORY);
+        temp.add(StringMatchesWithFlagDescriptor.FACTORY);
+        temp.add(StringReplaceDescriptor.FACTORY);
+        temp.add(StringReplaceWithFlagsDescriptor.FACTORY);
+        temp.add(StringLengthDescriptor.FACTORY);
+        temp.add(Substring2Descriptor.FACTORY);
+        temp.add(SubstringBeforeDescriptor.FACTORY);
+        temp.add(SubstringAfterDescriptor.FACTORY);
+        temp.add(StringToCodePointDescriptor.FACTORY);
+        temp.add(CodePointToStringDescriptor.FACTORY);
+        temp.add(StringConcatDescriptor.FACTORY);
+        temp.add(StringJoinDescriptor.FACTORY);
 
-		// aggregates
-		temp.add(ListifyAggregateDescriptor.FACTORY);
-		temp.add(CountAggregateDescriptor.FACTORY);
-		temp.add(AvgAggregateDescriptor.FACTORY);
-		temp.add(LocalAvgAggregateDescriptor.FACTORY);
-		temp.add(GlobalAvgAggregateDescriptor.FACTORY);
-		temp.add(SumAggregateDescriptor.FACTORY);
-		temp.add(LocalSumAggregateDescriptor.FACTORY);
-		temp.add(MaxAggregateDescriptor.FACTORY);
-		temp.add(LocalMaxAggregateDescriptor.FACTORY);
-		temp.add(MinAggregateDescriptor.FACTORY);
-		temp.add(LocalMinAggregateDescriptor.FACTORY);
+        // aggregates
+        temp.add(ListifyAggregateDescriptor.FACTORY);
+        temp.add(CountAggregateDescriptor.FACTORY);
+        temp.add(AvgAggregateDescriptor.FACTORY);
+        temp.add(LocalAvgAggregateDescriptor.FACTORY);
+        temp.add(GlobalAvgAggregateDescriptor.FACTORY);
+        temp.add(SumAggregateDescriptor.FACTORY);
+        temp.add(LocalSumAggregateDescriptor.FACTORY);
+        temp.add(MaxAggregateDescriptor.FACTORY);
+        temp.add(LocalMaxAggregateDescriptor.FACTORY);
+        temp.add(MinAggregateDescriptor.FACTORY);
+        temp.add(LocalMinAggregateDescriptor.FACTORY);
 
-		// serializable aggregates
-		temp.add(SerializableCountAggregateDescriptor.FACTORY);
-		temp.add(SerializableAvgAggregateDescriptor.FACTORY);
-		temp.add(SerializableLocalAvgAggregateDescriptor.FACTORY);
-		temp.add(SerializableGlobalAvgAggregateDescriptor.FACTORY);
-		temp.add(SerializableSumAggregateDescriptor.FACTORY);
-		temp.add(SerializableLocalSumAggregateDescriptor.FACTORY);
+        // serializable aggregates
+        temp.add(SerializableCountAggregateDescriptor.FACTORY);
+        temp.add(SerializableAvgAggregateDescriptor.FACTORY);
+        temp.add(SerializableLocalAvgAggregateDescriptor.FACTORY);
+        temp.add(SerializableGlobalAvgAggregateDescriptor.FACTORY);
+        temp.add(SerializableSumAggregateDescriptor.FACTORY);
+        temp.add(SerializableLocalSumAggregateDescriptor.FACTORY);
 
-		// scalar aggregates
-		temp.add(ScalarCountAggregateDescriptor.FACTORY);
-		temp.add(ScalarAvgAggregateDescriptor.FACTORY);
-		temp.add(ScalarSumAggregateDescriptor.FACTORY);
-		temp.add(ScalarMaxAggregateDescriptor.FACTORY);
-		temp.add(ScalarMinAggregateDescriptor.FACTORY);
+        // scalar aggregates
+        temp.add(ScalarCountAggregateDescriptor.FACTORY);
+        temp.add(ScalarAvgAggregateDescriptor.FACTORY);
+        temp.add(ScalarSumAggregateDescriptor.FACTORY);
+        temp.add(ScalarMaxAggregateDescriptor.FACTORY);
+        temp.add(ScalarMinAggregateDescriptor.FACTORY);
 
-		// new functions - constructors
-		temp.add(ABooleanConstructorDescriptor.FACTORY);
-		temp.add(ANullConstructorDescriptor.FACTORY);
-		temp.add(AStringConstructorDescriptor.FACTORY);
-		temp.add(AInt8ConstructorDescriptor.FACTORY);
-		temp.add(AInt16ConstructorDescriptor.FACTORY);
-		temp.add(AInt32ConstructorDescriptor.FACTORY);
-		temp.add(AInt64ConstructorDescriptor.FACTORY);
-		temp.add(AFloatConstructorDescriptor.FACTORY);
-		temp.add(ADoubleConstructorDescriptor.FACTORY);
-		temp.add(APointConstructorDescriptor.FACTORY);
-		temp.add(APoint3DConstructorDescriptor.FACTORY);
-		temp.add(ALineConstructorDescriptor.FACTORY);
-		temp.add(APolygonConstructorDescriptor.FACTORY);
-		temp.add(ACircleConstructorDescriptor.FACTORY);
-		temp.add(ARectangleConstructorDescriptor.FACTORY);
-		temp.add(ATimeConstructorDescriptor.FACTORY);
-		temp.add(ADateConstructorDescriptor.FACTORY);
-		temp.add(ADateTimeConstructorDescriptor.FACTORY);
-		temp.add(ADurationConstructorDescriptor.FACTORY);
+        // new functions - constructors
+        temp.add(ABooleanConstructorDescriptor.FACTORY);
+        temp.add(ANullConstructorDescriptor.FACTORY);
+        temp.add(AStringConstructorDescriptor.FACTORY);
+        temp.add(AInt8ConstructorDescriptor.FACTORY);
+        temp.add(AInt16ConstructorDescriptor.FACTORY);
+        temp.add(AInt32ConstructorDescriptor.FACTORY);
+        temp.add(AInt64ConstructorDescriptor.FACTORY);
+        temp.add(AFloatConstructorDescriptor.FACTORY);
+        temp.add(ADoubleConstructorDescriptor.FACTORY);
+        temp.add(APointConstructorDescriptor.FACTORY);
+        temp.add(APoint3DConstructorDescriptor.FACTORY);
+        temp.add(ALineConstructorDescriptor.FACTORY);
+        temp.add(APolygonConstructorDescriptor.FACTORY);
+        temp.add(ACircleConstructorDescriptor.FACTORY);
+        temp.add(ARectangleConstructorDescriptor.FACTORY);
+        temp.add(ATimeConstructorDescriptor.FACTORY);
+        temp.add(ADateConstructorDescriptor.FACTORY);
+        temp.add(ADateTimeConstructorDescriptor.FACTORY);
+        temp.add(ADurationConstructorDescriptor.FACTORY);
 
-		// Spatial
-		temp.add(CreatePointDescriptor.FACTORY);
-		temp.add(CreateLineDescriptor.FACTORY);
-		temp.add(CreatePolygonDescriptor.FACTORY);
-		temp.add(CreateCircleDescriptor.FACTORY);
-		temp.add(CreateRectangleDescriptor.FACTORY);
-		temp.add(SpatialAreaDescriptor.FACTORY);
-		temp.add(SpatialDistanceDescriptor.FACTORY);
-		temp.add(SpatialIntersectDescriptor.FACTORY);
-		temp.add(CreateMBRDescriptor.FACTORY);
-		temp.add(SpatialCellDescriptor.FACTORY);
-		temp.add(PointXCoordinateAccessor.FACTORY);
-		temp.add(PointYCoordinateAccessor.FACTORY);
-		temp.add(CircleRadiusAccessor.FACTORY);
-		temp.add(CircleCenterAccessor.FACTORY);
-		temp.add(LineRectanglePolygonAccessor.FACTORY);
+        // Spatial
+        temp.add(CreatePointDescriptor.FACTORY);
+        temp.add(CreateLineDescriptor.FACTORY);
+        temp.add(CreatePolygonDescriptor.FACTORY);
+        temp.add(CreateCircleDescriptor.FACTORY);
+        temp.add(CreateRectangleDescriptor.FACTORY);
+        temp.add(SpatialAreaDescriptor.FACTORY);
+        temp.add(SpatialDistanceDescriptor.FACTORY);
+        temp.add(SpatialIntersectDescriptor.FACTORY);
+        temp.add(CreateMBRDescriptor.FACTORY);
+        temp.add(SpatialCellDescriptor.FACTORY);
+        temp.add(PointXCoordinateAccessor.FACTORY);
+        temp.add(PointYCoordinateAccessor.FACTORY);
+        temp.add(CircleRadiusAccessor.FACTORY);
+        temp.add(CircleCenterAccessor.FACTORY);
+        temp.add(LineRectanglePolygonAccessor.FACTORY);
 
-		// fuzzyjoin function
-		temp.add(FuzzyEqDescriptor.FACTORY);
-		temp.add(SubsetCollectionDescriptor.FACTORY);
-		temp.add(PrefixLenJaccardDescriptor.FACTORY);
+        // fuzzyjoin function
+        temp.add(FuzzyEqDescriptor.FACTORY);
+        temp.add(SubsetCollectionDescriptor.FACTORY);
+        temp.add(PrefixLenJaccardDescriptor.FACTORY);
 
-		temp.add(WordTokensDescriptor.FACTORY);
-		temp.add(HashedWordTokensDescriptor.FACTORY);
-		temp.add(CountHashedWordTokensDescriptor.FACTORY);
+        temp.add(WordTokensDescriptor.FACTORY);
+        temp.add(HashedWordTokensDescriptor.FACTORY);
+        temp.add(CountHashedWordTokensDescriptor.FACTORY);
 
-		temp.add(GramTokensDescriptor.FACTORY);
-		temp.add(HashedGramTokensDescriptor.FACTORY);
-		temp.add(CountHashedGramTokensDescriptor.FACTORY);
+        temp.add(GramTokensDescriptor.FACTORY);
+        temp.add(HashedGramTokensDescriptor.FACTORY);
+        temp.add(CountHashedGramTokensDescriptor.FACTORY);
 
-		temp.add(EditDistanceDescriptor.FACTORY);
-		temp.add(EditDistanceCheckDescriptor.FACTORY);
-		temp.add(EditDistanceStringIsFilterable.FACTORY);
-		temp.add(EditDistanceListIsFilterable.FACTORY);
+        temp.add(EditDistanceDescriptor.FACTORY);
+        temp.add(EditDistanceCheckDescriptor.FACTORY);
+        temp.add(EditDistanceStringIsFilterable.FACTORY);
+        temp.add(EditDistanceListIsFilterable.FACTORY);
 
-		temp.add(SimilarityJaccardDescriptor.FACTORY);
-		temp.add(SimilarityJaccardCheckDescriptor.FACTORY);
-		temp.add(SimilarityJaccardSortedDescriptor.FACTORY);
-		temp.add(SimilarityJaccardSortedCheckDescriptor.FACTORY);
-		temp.add(SimilarityJaccardPrefixDescriptor.FACTORY);
-		temp.add(SimilarityJaccardPrefixCheckDescriptor.FACTORY);
+        temp.add(SimilarityJaccardDescriptor.FACTORY);
+        temp.add(SimilarityJaccardCheckDescriptor.FACTORY);
+        temp.add(SimilarityJaccardSortedDescriptor.FACTORY);
+        temp.add(SimilarityJaccardSortedCheckDescriptor.FACTORY);
+        temp.add(SimilarityJaccardPrefixDescriptor.FACTORY);
+        temp.add(SimilarityJaccardPrefixCheckDescriptor.FACTORY);
 
-		temp.add(SwitchCaseDescriptor.FACTORY);
-		temp.add(RegExpDescriptor.FACTORY);
-		temp.add(InjectFailureDescriptor.FACTORY);
-		temp.add(CastRecordDescriptor.FACTORY);
-		temp.add(NotNullDescriptor.FACTORY);
+        temp.add(SwitchCaseDescriptor.FACTORY);
+        temp.add(RegExpDescriptor.FACTORY);
+        temp.add(InjectFailureDescriptor.FACTORY);
+        temp.add(CastRecordDescriptor.FACTORY);
+        temp.add(NotNullDescriptor.FACTORY);
 
         // Spatial and temporal type accessors
         temp.add(TemporalYearAccessor.FACTORY);
@@ -518,425 +514,377 @@
         FunctionManagerHolder.setFunctionManager(mgr);
     }
 
-	@Override
-	public IBinaryBooleanInspectorFactory getBinaryBooleanInspectorFactory() {
-		return AqlBinaryBooleanInspectorImpl.FACTORY;
-	}
+    @Override
+    public IBinaryBooleanInspectorFactory getBinaryBooleanInspectorFactory() {
+        return AqlBinaryBooleanInspectorImpl.FACTORY;
+    }
 
-	@Override
-	public IBinaryComparatorFactoryProvider getBinaryComparatorFactoryProvider() {
-		return AqlBinaryComparatorFactoryProvider.INSTANCE;
-	}
+    @Override
+    public IBinaryComparatorFactoryProvider getBinaryComparatorFactoryProvider() {
+        return AqlBinaryComparatorFactoryProvider.INSTANCE;
+    }
 
-	@Override
-	public IBinaryHashFunctionFactoryProvider getBinaryHashFunctionFactoryProvider() {
-		return AqlBinaryHashFunctionFactoryProvider.INSTANCE;
-	}
+    @Override
+    public IBinaryHashFunctionFactoryProvider getBinaryHashFunctionFactoryProvider() {
+        return AqlBinaryHashFunctionFactoryProvider.INSTANCE;
+    }
 
-	@Override
-	public ISerializerDeserializerProvider getSerdeProvider() {
-		return AqlSerializerDeserializerProvider.INSTANCE; // done
-	}
+    @Override
+    public ISerializerDeserializerProvider getSerdeProvider() {
+        return AqlSerializerDeserializerProvider.INSTANCE; // done
+    }
 
-	@Override
-	public ITypeTraitProvider getTypeTraitProvider() {
-		return AqlTypeTraitProvider.INSTANCE;
-	}
+    @Override
+    public ITypeTraitProvider getTypeTraitProvider() {
+        return AqlTypeTraitProvider.INSTANCE;
+    }
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public ICopyEvaluatorFactory getFieldAccessEvaluatorFactory(
-			ARecordType recType, String fldName, int recordColumn)
-			throws AlgebricksException {
-		String[] names = recType.getFieldNames();
-		int n = names.length;
-		for (int i = 0; i < n; i++) {
-			if (names[i].equals(fldName)) {
-				ICopyEvaluatorFactory recordEvalFactory = new ColumnAccessEvalFactory(
-						recordColumn);
-				ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
-				DataOutput dos = abvs.getDataOutput();
-				try {
-					AInt32 ai = new AInt32(i);
-					AqlSerializerDeserializerProvider.INSTANCE
-							.getSerializerDeserializer(ai.getType()).serialize(
-									ai, dos);
-				} catch (HyracksDataException e) {
-					throw new AlgebricksException(e);
-				}
-				ICopyEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(
-						Arrays.copyOf(abvs.getByteArray(), abvs.getLength()));
-				ICopyEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(
-						recordEvalFactory, fldIndexEvalFactory, recType);
-				return evalFactory;
-			}
-		}
-		throw new AlgebricksException("Could not find field " + fldName
-				+ " in the schema.");
-	}
+    @SuppressWarnings("unchecked")
+    @Override
+    public ICopyEvaluatorFactory getFieldAccessEvaluatorFactory(ARecordType recType, String fldName, int recordColumn)
+            throws AlgebricksException {
+        String[] names = recType.getFieldNames();
+        int n = names.length;
+        for (int i = 0; i < n; i++) {
+            if (names[i].equals(fldName)) {
+                ICopyEvaluatorFactory recordEvalFactory = new ColumnAccessEvalFactory(recordColumn);
+                ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
+                DataOutput dos = abvs.getDataOutput();
+                try {
+                    AInt32 ai = new AInt32(i);
+                    AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(ai.getType()).serialize(ai,
+                            dos);
+                } catch (HyracksDataException e) {
+                    throw new AlgebricksException(e);
+                }
+                ICopyEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
+                        abvs.getLength()));
+                ICopyEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(recordEvalFactory,
+                        fldIndexEvalFactory, recType);
+                return evalFactory;
+            }
+        }
+        throw new AlgebricksException("Could not find field " + fldName + " in the schema.");
+    }
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public ICopyEvaluatorFactory[] createMBRFactory(ARecordType recType,
-			String fldName, int recordColumn, int dimension)
-			throws AlgebricksException {
-		ICopyEvaluatorFactory evalFactory = getFieldAccessEvaluatorFactory(
-				recType, fldName, recordColumn);
-		int numOfFields = dimension * 2;
-		ICopyEvaluatorFactory[] evalFactories = new ICopyEvaluatorFactory[numOfFields];
+    @SuppressWarnings("unchecked")
+    @Override
+    public ICopyEvaluatorFactory[] createMBRFactory(ARecordType recType, String fldName, int recordColumn, int dimension)
+            throws AlgebricksException {
+        ICopyEvaluatorFactory evalFactory = getFieldAccessEvaluatorFactory(recType, fldName, recordColumn);
+        int numOfFields = dimension * 2;
+        ICopyEvaluatorFactory[] evalFactories = new ICopyEvaluatorFactory[numOfFields];
 
-		ArrayBackedValueStorage abvs1 = new ArrayBackedValueStorage();
-		DataOutput dos1 = abvs1.getDataOutput();
-		try {
-			AInt32 ai = new AInt32(dimension);
-			AqlSerializerDeserializerProvider.INSTANCE
-					.getSerializerDeserializer(ai.getType())
-					.serialize(ai, dos1);
-		} catch (HyracksDataException e) {
-			throw new AlgebricksException(e);
-		}
-		ICopyEvaluatorFactory dimensionEvalFactory = new ConstantEvalFactory(
-				Arrays.copyOf(abvs1.getByteArray(), abvs1.getLength()));
+        ArrayBackedValueStorage abvs1 = new ArrayBackedValueStorage();
+        DataOutput dos1 = abvs1.getDataOutput();
+        try {
+            AInt32 ai = new AInt32(dimension);
+            AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(ai.getType()).serialize(ai, dos1);
+        } catch (HyracksDataException e) {
+            throw new AlgebricksException(e);
+        }
+        ICopyEvaluatorFactory dimensionEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs1.getByteArray(),
+                abvs1.getLength()));
 
-		for (int i = 0; i < numOfFields; i++) {
-			ArrayBackedValueStorage abvs2 = new ArrayBackedValueStorage();
-			DataOutput dos2 = abvs2.getDataOutput();
-			try {
-				AInt32 ai = new AInt32(i);
-				AqlSerializerDeserializerProvider.INSTANCE
-						.getSerializerDeserializer(ai.getType()).serialize(ai,
-								dos2);
-			} catch (HyracksDataException e) {
-				throw new AlgebricksException(e);
-			}
-			ICopyEvaluatorFactory coordinateEvalFactory = new ConstantEvalFactory(
-					Arrays.copyOf(abvs2.getByteArray(), abvs2.getLength()));
+        for (int i = 0; i < numOfFields; i++) {
+            ArrayBackedValueStorage abvs2 = new ArrayBackedValueStorage();
+            DataOutput dos2 = abvs2.getDataOutput();
+            try {
+                AInt32 ai = new AInt32(i);
+                AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(ai.getType()).serialize(ai, dos2);
+            } catch (HyracksDataException e) {
+                throw new AlgebricksException(e);
+            }
+            ICopyEvaluatorFactory coordinateEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs2.getByteArray(),
+                    abvs2.getLength()));
 
-			evalFactories[i] = new CreateMBREvalFactory(evalFactory,
-					dimensionEvalFactory, coordinateEvalFactory);
-		}
-		return evalFactories;
-	}
+            evalFactories[i] = new CreateMBREvalFactory(evalFactory, dimensionEvalFactory, coordinateEvalFactory);
+        }
+        return evalFactories;
+    }
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType> partitioningEvaluatorFactory(
-			ARecordType recType, String fldName) throws AlgebricksException {
-		String[] names = recType.getFieldNames();
-		int n = names.length;
-		for (int i = 0; i < n; i++) {
-			if (names[i].equals(fldName)) {
-				ICopyEvaluatorFactory recordEvalFactory = new ColumnAccessEvalFactory(
-						GlobalConfig.DEFAULT_INPUT_DATA_COLUMN);
-				ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
-				DataOutput dos = abvs.getDataOutput();
-				try {
-					AInt32 ai = new AInt32(i);
-					AqlSerializerDeserializerProvider.INSTANCE
-							.getSerializerDeserializer(ai.getType()).serialize(
-									ai, dos);
-				} catch (HyracksDataException e) {
-					throw new AlgebricksException(e);
-				}
-				ICopyEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(
-						Arrays.copyOf(abvs.getByteArray(), abvs.getLength()));
-				ICopyEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(
-						recordEvalFactory, fldIndexEvalFactory, recType);
-				IFunctionInfo finfoAccess = AsterixBuiltinFunctions
-						.getAsterixFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX);
+    @SuppressWarnings("unchecked")
+    @Override
+    public Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType> partitioningEvaluatorFactory(
+            ARecordType recType, String fldName) throws AlgebricksException {
+        String[] names = recType.getFieldNames();
+        int n = names.length;
+        for (int i = 0; i < n; i++) {
+            if (names[i].equals(fldName)) {
+                ICopyEvaluatorFactory recordEvalFactory = new ColumnAccessEvalFactory(
+                        GlobalConfig.DEFAULT_INPUT_DATA_COLUMN);
+                ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
+                DataOutput dos = abvs.getDataOutput();
+                try {
+                    AInt32 ai = new AInt32(i);
+                    AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(ai.getType()).serialize(ai,
+                            dos);
+                } catch (HyracksDataException e) {
+                    throw new AlgebricksException(e);
+                }
+                ICopyEvaluatorFactory fldIndexEvalFactory = new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
+                        abvs.getLength()));
+                ICopyEvaluatorFactory evalFactory = new FieldAccessByIndexEvalFactory(recordEvalFactory,
+                        fldIndexEvalFactory, recType);
+                IFunctionInfo finfoAccess = AsterixBuiltinFunctions
+                        .getAsterixFunctionInfo(AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX);
 
-				ScalarFunctionCallExpression partitionFun = new ScalarFunctionCallExpression(
-						finfoAccess,
-						new MutableObject<ILogicalExpression>(
-								new VariableReferenceExpression(
-										METADATA_DUMMY_VAR)),
-						new MutableObject<ILogicalExpression>(
-								new ConstantExpression(
-										new AsterixConstantValue(new AInt32(i)))));
-				return new Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType>(
-						evalFactory, partitionFun, recType.getFieldTypes()[i]);
-			}
-		}
-		throw new AlgebricksException("Could not find field " + fldName
-				+ " in the schema.");
-	}
+                ScalarFunctionCallExpression partitionFun = new ScalarFunctionCallExpression(finfoAccess,
+                        new MutableObject<ILogicalExpression>(new VariableReferenceExpression(METADATA_DUMMY_VAR)),
+                        new MutableObject<ILogicalExpression>(new ConstantExpression(new AsterixConstantValue(
+                                new AInt32(i)))));
+                return new Triple<ICopyEvaluatorFactory, ScalarFunctionCallExpression, IAType>(evalFactory,
+                        partitionFun, recType.getFieldTypes()[i]);
+            }
+        }
+        throw new AlgebricksException("Could not find field " + fldName + " in the schema.");
+    }
 
-	@Override
-	public IFunctionDescriptor resolveFunction(ILogicalExpression expr,
-			IVariableTypeEnvironment context) throws AlgebricksException {
-		FunctionIdentifier fnId = ((AbstractFunctionCallExpression) expr)
-				.getFunctionIdentifier();
-		IFunctionManager mgr = FunctionManagerHolder.getFunctionManager();
-		IFunctionDescriptor fd = mgr.lookupFunction(fnId);
-		if (fd == null) {
-			throw new AsterixRuntimeException("Unresolved function " + fnId);
-		}
-		typeInference(expr, fd, context);
-		return fd;
-	}
+    @Override
+    public IFunctionDescriptor resolveFunction(ILogicalExpression expr, IVariableTypeEnvironment context)
+            throws AlgebricksException {
+        FunctionIdentifier fnId = ((AbstractFunctionCallExpression) expr).getFunctionIdentifier();
+        IFunctionManager mgr = FunctionManagerHolder.getFunctionManager();
+        IFunctionDescriptor fd = mgr.lookupFunction(fnId);
+        if (fd == null) {
+            throw new AsterixRuntimeException("Unresolved function " + fnId);
+        }
+        typeInference(expr, fd, context);
+        return fd;
+    }
 
-	private void typeInference(ILogicalExpression expr, IFunctionDescriptor fd,
-			IVariableTypeEnvironment context) throws AlgebricksException {
-		if (fd.getIdentifier().equals(AsterixBuiltinFunctions.LISTIFY)) {
-			AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expr;
-			if (f.getArguments().size() == 0) {
-				((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(
-						null, null));
-			} else {
-				IAType itemType = (IAType) context.getType(f.getArguments()
-						.get(0).getValue());
-				// Convert UNION types into ANY.
-				if (itemType instanceof AUnionType) {
-					itemType = BuiltinType.ANY;
-				}
-				((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(
-						itemType, null));
-			}
-		}
-		if (fd.getIdentifier().equals(AsterixBuiltinFunctions.CAST_RECORD)) {
-			ARecordType rt = (ARecordType) TypeComputerUtilities
-					.getRequiredType((AbstractFunctionCallExpression) expr);
-			ARecordType it = (ARecordType) TypeComputerUtilities
-					.getInputType((AbstractFunctionCallExpression) expr);
-			((CastRecordDescriptor) fd).reset(rt, it);
-		}
-		if (fd.getIdentifier().equals(
-				AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)) {
-			ARecordType rt = (ARecordType) context.getType(expr);
-			((OpenRecordConstructorDescriptor) fd)
-					.reset(rt,
-							computeOpenFields(
-									(AbstractFunctionCallExpression) expr, rt));
-		}
-		if (fd.getIdentifier().equals(
-				AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR)) {
-			((ClosedRecordConstructorDescriptor) fd)
-					.reset((ARecordType) context.getType(expr));
-		}
-		if (fd.getIdentifier().equals(
-				AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR)) {
-			((OrderedListConstructorDescriptor) fd)
-					.reset((AOrderedListType) context.getType(expr));
-		}
-		if (fd.getIdentifier().equals(
-				AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR)) {
-			((UnorderedListConstructorDescriptor) fd)
-					.reset((AUnorderedListType) context.getType(expr));
-		}
-		if (fd.getIdentifier().equals(
-				AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX)) {
-			AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
-			IAType t = (IAType) context.getType(fce.getArguments().get(0)
-					.getValue());
-			switch (t.getTypeTag()) {
-			case RECORD: {
-				ARecordType recType = (ARecordType) t;
-				((FieldAccessByIndexDescriptor) fd).reset(recType);
-				break;
-			}
-			case UNION: {
-				AUnionType unionT = (AUnionType) t;
-				if (unionT.isNullableType()) {
-					IAType t2 = unionT.getUnionList().get(1);
-					if (t2.getTypeTag() == ATypeTag.RECORD) {
-						ARecordType recType = (ARecordType) t2;
-						((FieldAccessByIndexDescriptor) fd).reset(recType);
-						break;
-					}
-				}
-				throw new NotImplementedException(
-						"field-access-by-index for data of type " + t);
-			}
-			default: {
-				throw new NotImplementedException(
-						"field-access-by-index for data of type " + t);
-			}
-			}
-		}
-	}
+    private void typeInference(ILogicalExpression expr, IFunctionDescriptor fd, IVariableTypeEnvironment context)
+            throws AlgebricksException {
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.LISTIFY)) {
+            AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expr;
+            if (f.getArguments().size() == 0) {
+                ((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(null, null));
+            } else {
+                IAType itemType = (IAType) context.getType(f.getArguments().get(0).getValue());
+                // Convert UNION types into ANY.
+                if (itemType instanceof AUnionType) {
+                    itemType = BuiltinType.ANY;
+                }
+                ((ListifyAggregateDescriptor) fd).reset(new AOrderedListType(itemType, null));
+            }
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.CAST_RECORD)) {
+            ARecordType rt = (ARecordType) TypeComputerUtilities.getRequiredType((AbstractFunctionCallExpression) expr);
+            ARecordType it = (ARecordType) TypeComputerUtilities.getInputType((AbstractFunctionCallExpression) expr);
+            ((CastRecordDescriptor) fd).reset(rt, it);
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)) {
+            ARecordType rt = (ARecordType) context.getType(expr);
+            ((OpenRecordConstructorDescriptor) fd).reset(rt,
+                    computeOpenFields((AbstractFunctionCallExpression) expr, rt));
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR)) {
+            ((ClosedRecordConstructorDescriptor) fd).reset((ARecordType) context.getType(expr));
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.ORDERED_LIST_CONSTRUCTOR)) {
+            ((OrderedListConstructorDescriptor) fd).reset((AOrderedListType) context.getType(expr));
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.UNORDERED_LIST_CONSTRUCTOR)) {
+            ((UnorderedListConstructorDescriptor) fd).reset((AUnorderedListType) context.getType(expr));
+        }
+        if (fd.getIdentifier().equals(AsterixBuiltinFunctions.FIELD_ACCESS_BY_INDEX)) {
+            AbstractFunctionCallExpression fce = (AbstractFunctionCallExpression) expr;
+            IAType t = (IAType) context.getType(fce.getArguments().get(0).getValue());
+            switch (t.getTypeTag()) {
+                case RECORD: {
+                    ARecordType recType = (ARecordType) t;
+                    ((FieldAccessByIndexDescriptor) fd).reset(recType);
+                    break;
+                }
+                case UNION: {
+                    AUnionType unionT = (AUnionType) t;
+                    if (unionT.isNullableType()) {
+                        IAType t2 = unionT.getUnionList().get(1);
+                        if (t2.getTypeTag() == ATypeTag.RECORD) {
+                            ARecordType recType = (ARecordType) t2;
+                            ((FieldAccessByIndexDescriptor) fd).reset(recType);
+                            break;
+                        }
+                    }
+                    throw new NotImplementedException("field-access-by-index for data of type " + t);
+                }
+                default: {
+                    throw new NotImplementedException("field-access-by-index for data of type " + t);
+                }
+            }
+        }
+    }
 
-	private boolean[] computeOpenFields(AbstractFunctionCallExpression expr,
-			ARecordType recType) {
-		int n = expr.getArguments().size() / 2;
-		boolean[] open = new boolean[n];
-		for (int i = 0; i < n; i++) {
-			Mutable<ILogicalExpression> argRef = expr.getArguments().get(2 * i);
-			ILogicalExpression arg = argRef.getValue();
-			if (arg.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
-				String fn = ((AString) ((AsterixConstantValue) ((ConstantExpression) arg)
-						.getValue()).getObject()).getStringValue();
-				open[i] = true;
-				for (String s : recType.getFieldNames()) {
-					if (s.equals(fn)) {
-						open[i] = false;
-						break;
-					}
-				}
-			} else {
-				open[i] = true;
-			}
-		}
-		return open;
-	}
+    private boolean[] computeOpenFields(AbstractFunctionCallExpression expr, ARecordType recType) {
+        int n = expr.getArguments().size() / 2;
+        boolean[] open = new boolean[n];
+        for (int i = 0; i < n; i++) {
+            Mutable<ILogicalExpression> argRef = expr.getArguments().get(2 * i);
+            ILogicalExpression arg = argRef.getValue();
+            if (arg.getExpressionTag() == LogicalExpressionTag.CONSTANT) {
+                String fn = ((AString) ((AsterixConstantValue) ((ConstantExpression) arg).getValue()).getObject())
+                        .getStringValue();
+                open[i] = true;
+                for (String s : recType.getFieldNames()) {
+                    if (s.equals(fn)) {
+                        open[i] = false;
+                        break;
+                    }
+                }
+            } else {
+                open[i] = true;
+            }
+        }
+        return open;
+    }
 
-	@Override
-	public IPrinterFactoryProvider getPrinterFactoryProvider() {
-		return AqlPrinterFactoryProvider.INSTANCE;
-	}
+    @Override
+    public IPrinterFactoryProvider getPrinterFactoryProvider() {
+        return AqlPrinterFactoryProvider.INSTANCE;
+    }
 
-	@SuppressWarnings("unchecked")
-	@Override
-	public ICopyEvaluatorFactory getConstantEvalFactory(
-			IAlgebricksConstantValue value) throws AlgebricksException {
-		IAObject obj = null;
-		if (value.isNull()) {
-			obj = ANull.NULL;
-		} else if (value.isTrue()) {
-			obj = ABoolean.TRUE;
-		} else if (value.isFalse()) {
-			obj = ABoolean.FALSE;
-		} else {
-			AsterixConstantValue acv = (AsterixConstantValue) value;
-			obj = acv.getObject();
-		}
-		ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
-		DataOutput dos = abvs.getDataOutput();
-		try {
-			AqlSerializerDeserializerProvider.INSTANCE
-					.getSerializerDeserializer(obj.getType()).serialize(obj,
-							dos);
-		} catch (HyracksDataException e) {
-			throw new AlgebricksException(e);
-		}
-		return new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(),
-				abvs.getLength()));
-	}
+    @Override
+    public IPrinterFactoryProvider getJSONPrinterFactoryProvider() {
+        return AqlJSONPrinterFactoryProvider.INSTANCE;
+    }
 
-	@Override
-	public IBinaryIntegerInspectorFactory getBinaryIntegerInspectorFactory() {
-		return AqlBinaryIntegerInspector.FACTORY;
-	}
+    @SuppressWarnings("unchecked")
+    @Override
+    public ICopyEvaluatorFactory getConstantEvalFactory(IAlgebricksConstantValue value) throws AlgebricksException {
+        IAObject obj = null;
+        if (value.isNull()) {
+            obj = ANull.NULL;
+        } else if (value.isTrue()) {
+            obj = ABoolean.TRUE;
+        } else if (value.isFalse()) {
+            obj = ABoolean.FALSE;
+        } else {
+            AsterixConstantValue acv = (AsterixConstantValue) value;
+            obj = acv.getObject();
+        }
+        ArrayBackedValueStorage abvs = new ArrayBackedValueStorage();
+        DataOutput dos = abvs.getDataOutput();
+        try {
+            AqlSerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(obj.getType()).serialize(obj, dos);
+        } catch (HyracksDataException e) {
+            throw new AlgebricksException(e);
+        }
+        return new ConstantEvalFactory(Arrays.copyOf(abvs.getByteArray(), abvs.getLength()));
+    }
 
-	@Override
-	public ITupleParserFactory createTupleParser(ARecordType recType,
-			IParseFileSplitsDecl decl) {
-		if (decl.isDelimitedFileFormat()) {
-			int n = recType.getFieldTypes().length;
-			IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
-			for (int i = 0; i < n; i++) {
-				ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
-				IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
-				if (vpf == null) {
-					throw new NotImplementedException(
-							"No value parser factory for delimited fields of type "
-									+ tag);
-				}
-				fieldParserFactories[i] = vpf;
-			}
-			return new NtDelimitedDataTupleParserFactory(recType,
-					fieldParserFactories, decl.getDelimChar());
-		} else {
-			return new AdmSchemafullRecordParserFactory(recType);
-		}
-	}
+    @Override
+    public IBinaryIntegerInspectorFactory getBinaryIntegerInspectorFactory() {
+        return AqlBinaryIntegerInspector.FACTORY;
+    }
 
-	@Override
-	public ITupleParserFactory createTupleParser(ARecordType recType,
-			boolean delimitedFormat, Character delimiter) {
-		if (delimitedFormat) {
-			int n = recType.getFieldTypes().length;
-			IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
-			for (int i = 0; i < n; i++) {
-				ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
-				IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
-				if (vpf == null) {
-					throw new NotImplementedException(
-							"No value parser factory for delimited fields of type "
-									+ tag);
-				}
-				fieldParserFactories[i] = vpf;
-			}
-			return new NtDelimitedDataTupleParserFactory(recType,
-					fieldParserFactories, delimiter);
-		} else {
-			return new AdmSchemafullRecordParserFactory(recType);
-		}
-	}
+    @Override
+    public ITupleParserFactory createTupleParser(ARecordType recType, IParseFileSplitsDecl decl) {
+        if (decl.isDelimitedFileFormat()) {
+            int n = recType.getFieldTypes().length;
+            IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
+            for (int i = 0; i < n; i++) {
+                ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
+                IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
+                if (vpf == null) {
+                    throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
+                }
+                fieldParserFactories[i] = vpf;
+            }
+            return new NtDelimitedDataTupleParserFactory(recType, fieldParserFactories, decl.getDelimChar());
+        } else {
+            return new AdmSchemafullRecordParserFactory(recType);
+        }
+    }
 
-	@Override
-	public INullWriterFactory getNullWriterFactory() {
-		return AqlNullWriterFactory.INSTANCE;
-	}
+    @Override
+    public ITupleParserFactory createTupleParser(ARecordType recType, boolean delimitedFormat, Character delimiter) {
+        if (delimitedFormat) {
+            int n = recType.getFieldTypes().length;
+            IValueParserFactory[] fieldParserFactories = new IValueParserFactory[n];
+            for (int i = 0; i < n; i++) {
+                ATypeTag tag = recType.getFieldTypes()[i].getTypeTag();
+                IValueParserFactory vpf = typeToValueParserFactMap.get(tag);
+                if (vpf == null) {
+                    throw new NotImplementedException("No value parser factory for delimited fields of type " + tag);
+                }
+                fieldParserFactories[i] = vpf;
+            }
+            return new NtDelimitedDataTupleParserFactory(recType, fieldParserFactories, delimiter);
+        } else {
+            return new AdmSchemafullRecordParserFactory(recType);
+        }
+    }
 
-	@Override
-	public IExpressionEvalSizeComputer getExpressionEvalSizeComputer() {
-		return new IExpressionEvalSizeComputer() {
-			@Override
-			public int getEvalSize(ILogicalExpression expr,
-					IVariableEvalSizeEnvironment env)
-					throws AlgebricksException {
-				switch (expr.getExpressionTag()) {
-				case CONSTANT: {
-					ConstantExpression c = (ConstantExpression) expr;
-					if (c == ConstantExpression.NULL) {
-						return 1;
-					} else if (c == ConstantExpression.FALSE
-							|| c == ConstantExpression.TRUE) {
-						return 2;
-					} else {
-						AsterixConstantValue acv = (AsterixConstantValue) c
-								.getValue();
-						IAObject o = acv.getObject();
-						switch (o.getType().getTypeTag()) {
-						case DOUBLE: {
-							return 9;
-						}
-						case BOOLEAN: {
-							return 2;
-						}
-						case NULL: {
-							return 1;
-						}
-						case INT32: {
-							return 5;
-						}
-						case INT64: {
-							return 9;
-						}
-						default: {
-							// TODO
-							return -1;
-						}
-						}
-					}
-				}
-				case FUNCTION_CALL: {
-					AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expr;
-					if (f.getFunctionIdentifier().equals(
-							AsterixBuiltinFunctions.TID)) {
-						return 5;
-					} else {
-						// TODO
-						return -1;
-					}
-				}
-				default: {
-					// TODO
-					return -1;
-				}
-				}
-			}
-		};
-	}
+    @Override
+    public INullWriterFactory getNullWriterFactory() {
+        return AqlNullWriterFactory.INSTANCE;
+    }
 
-	@Override
-	public INormalizedKeyComputerFactoryProvider getNormalizedKeyComputerFactoryProvider() {
-		return AqlNormalizedKeyComputerFactoryProvider.INSTANCE;
-	}
+    @Override
+    public IExpressionEvalSizeComputer getExpressionEvalSizeComputer() {
+        return new IExpressionEvalSizeComputer() {
+            @Override
+            public int getEvalSize(ILogicalExpression expr, IVariableEvalSizeEnvironment env)
+                    throws AlgebricksException {
+                switch (expr.getExpressionTag()) {
+                    case CONSTANT: {
+                        ConstantExpression c = (ConstantExpression) expr;
+                        if (c == ConstantExpression.NULL) {
+                            return 1;
+                        } else if (c == ConstantExpression.FALSE || c == ConstantExpression.TRUE) {
+                            return 2;
+                        } else {
+                            AsterixConstantValue acv = (AsterixConstantValue) c.getValue();
+                            IAObject o = acv.getObject();
+                            switch (o.getType().getTypeTag()) {
+                                case DOUBLE: {
+                                    return 9;
+                                }
+                                case BOOLEAN: {
+                                    return 2;
+                                }
+                                case NULL: {
+                                    return 1;
+                                }
+                                case INT32: {
+                                    return 5;
+                                }
+                                case INT64: {
+                                    return 9;
+                                }
+                                default: {
+                                    // TODO
+                                    return -1;
+                                }
+                            }
+                        }
+                    }
+                    case FUNCTION_CALL: {
+                        AbstractFunctionCallExpression f = (AbstractFunctionCallExpression) expr;
+                        if (f.getFunctionIdentifier().equals(AsterixBuiltinFunctions.TID)) {
+                            return 5;
+                        } else {
+                            // TODO
+                            return -1;
+                        }
+                    }
+                    default: {
+                        // TODO
+                        return -1;
+                    }
+                }
+            }
+        };
+    }
 
-	@Override
-	public IBinaryHashFunctionFamilyProvider getBinaryHashFunctionFamilyProvider() {
-		return AqlBinaryHashFunctionFamilyProvider.INSTANCE;
-	}
+    @Override
+    public INormalizedKeyComputerFactoryProvider getNormalizedKeyComputerFactoryProvider() {
+        return AqlNormalizedKeyComputerFactoryProvider.INSTANCE;
+    }
+
+    @Override
+    public IBinaryHashFunctionFamilyProvider getBinaryHashFunctionFamilyProvider() {
+        return AqlBinaryHashFunctionFamilyProvider.INSTANCE;
+    }
 
 }
