asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sjaco...@apache.org
Subject [2/3] asterixdb git commit: Make query plans more user-friendly.
Date Tue, 09 May 2017 21:16:03 GMT
http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.1.ddl.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.1.ddl.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.1.ddl.sqlpp
new file mode 100644
index 0000000..aaa62aa
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.1.ddl.sqlpp
@@ -0,0 +1,31 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ */
+
+DROP DATAVERSE gby IF EXISTS;
+CREATE DATAVERSE gby;
+
+USE gby;
+
+CREATE TYPE EmployeeType AS {
+  id : string,
+  department_id: string,
+  salary : float
+}
+
+CREATE DATASET Employee(EmployeeType) PRIMARY KEY id;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.2.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.2.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.2.query.sqlpp
new file mode 100644
index 0000000..e170a6e
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_field_access_closed/explain_field_access_closed.2.query.sqlpp
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ */
+
+USE gby;
+
+EXPLAIN
+FROM Employee e
+GROUP BY substr(e.department_id, 1)
+SELECT substr(e.department_id, 1) as deptId, SUM(e.salary) AS star_cost;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-01/explain_object_constructor-01.1.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-01/explain_object_constructor-01.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-01/explain_object_constructor-01.1.query.sqlpp
new file mode 100644
index 0000000..f4e46e4
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-01/explain_object_constructor-01.1.query.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ */
+
+EXPLAIN SELECT VALUE {"a": "1", "b": 1};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-02/explain_object_constructor-02.1.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-02/explain_object_constructor-02.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-02/explain_object_constructor-02.1.query.sqlpp
new file mode 100644
index 0000000..3b7fe02
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-02/explain_object_constructor-02.1.query.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ */
+
+EXPLAIN SELECT VALUE {"a": "1"};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-03/explain_object_constructor-03.1.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-03/explain_object_constructor-03.1.query.sqlpp b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-03/explain_object_constructor-03.1.query.sqlpp
new file mode 100644
index 0000000..991e557
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_object_constructor-03/explain_object_constructor-03.1.query.sqlpp
@@ -0,0 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *   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.
+ */
+
+EXPLAIN SELECT VALUE { };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access/explain_field_access.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access/explain_field_access.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access/explain_field_access.1.adm
new file mode 100644
index 0000000..055512a
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access/explain_field_access.1.adm
@@ -0,0 +1,46 @@
+distribute result [$$19]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$19])
+    -- STREAM_PROJECT  |PARTITIONED|
+      assign [$$19] <- [{"deptId": $#1, "star_cost": $$22}]
+      -- ASSIGN  |PARTITIONED|
+        exchange
+        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+          group by ([$#1 := $$27]) decor ([]) {
+                    aggregate [$$22] <- [agg-sql-sum($$26)]
+                    -- AGGREGATE  |LOCAL|
+                      nested tuple source
+                      -- NESTED_TUPLE_SOURCE  |LOCAL|
+                 }
+          -- SORT_GROUP_BY[$$27]  |PARTITIONED|
+            exchange
+            -- HASH_PARTITION_EXCHANGE [$$27]  |PARTITIONED|
+              group by ([$$27 := $$20]) decor ([]) {
+                        aggregate [$$26] <- [agg-local-sql-sum($$17)]
+                        -- AGGREGATE  |LOCAL|
+                          nested tuple source
+                          -- NESTED_TUPLE_SOURCE  |LOCAL|
+                     }
+              -- SORT_GROUP_BY[$$20]  |PARTITIONED|
+                exchange
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                  project ([$$17, $$20])
+                  -- STREAM_PROJECT  |PARTITIONED|
+                    assign [$$20] <- [substring($$24.getField("department_id"), 1)]
+                    -- ASSIGN  |PARTITIONED|
+                      project ([$$17, $$24])
+                      -- STREAM_PROJECT  |PARTITIONED|
+                        assign [$$17, $$24] <- [$$e.getField("salary"), $$e.getField("dept")]
+                        -- ASSIGN  |PARTITIONED|
+                          project ([$$e])
+                          -- STREAM_PROJECT  |PARTITIONED|
+                            exchange
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              data-scan []<-[$$21, $$e] <- gby.Employee
+                              -- DATASOURCE_SCAN  |PARTITIONED|
+                                exchange
+                                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                                  empty-tuple-source
+                                  -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access_closed/explain_field_access_closed.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access_closed/explain_field_access_closed.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access_closed/explain_field_access_closed.1.adm
new file mode 100644
index 0000000..d7f1893
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_field_access_closed/explain_field_access_closed.1.adm
@@ -0,0 +1,42 @@
+distribute result [$$18]
+-- DISTRIBUTE_RESULT  |PARTITIONED|
+  exchange
+  -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+    project ([$$18])
+    -- STREAM_PROJECT  |PARTITIONED|
+      assign [$$18] <- [{"deptId": $#1, "star_cost": $$21}]
+      -- ASSIGN  |PARTITIONED|
+        exchange
+        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+          group by ([$#1 := $$25]) decor ([]) {
+                    aggregate [$$21] <- [agg-sql-sum($$24)]
+                    -- AGGREGATE  |LOCAL|
+                      nested tuple source
+                      -- NESTED_TUPLE_SOURCE  |LOCAL|
+                 }
+          -- SORT_GROUP_BY[$$25]  |PARTITIONED|
+            exchange
+            -- HASH_PARTITION_EXCHANGE [$$25]  |PARTITIONED|
+              group by ([$$25 := $$19]) decor ([]) {
+                        aggregate [$$24] <- [agg-local-sql-sum($$16)]
+                        -- AGGREGATE  |LOCAL|
+                          nested tuple source
+                          -- NESTED_TUPLE_SOURCE  |LOCAL|
+                     }
+              -- SORT_GROUP_BY[$$19]  |PARTITIONED|
+                exchange
+                -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                  project ([$$16, $$19])
+                  -- STREAM_PROJECT  |PARTITIONED|
+                    assign [$$19, $$16] <- [substring($$e.getField(1), 1), $$e.getField(2)]
+                    -- ASSIGN  |PARTITIONED|
+                      project ([$$e])
+                      -- STREAM_PROJECT  |PARTITIONED|
+                        exchange
+                        -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                          data-scan []<-[$$20, $$e] <- gby.Employee
+                          -- DATASOURCE_SCAN  |PARTITIONED|
+                            exchange
+                            -- ONE_TO_ONE_EXCHANGE  |PARTITIONED|
+                              empty-tuple-source
+                              -- EMPTY_TUPLE_SOURCE  |PARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-01/explain_object_constructor-01.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-01/explain_object_constructor-01.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-01/explain_object_constructor-01.1.adm
new file mode 100644
index 0000000..9a536a6
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-01/explain_object_constructor-01.1.adm
@@ -0,0 +1,8 @@
+distribute result [$$2]
+-- DISTRIBUTE_RESULT  |UNPARTITIONED|
+  exchange
+  -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
+    assign [$$2] <- [{ a: "1", b: 1 }]
+    -- ASSIGN  |UNPARTITIONED|
+      empty-tuple-source
+      -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-02/explain_object_constructor-02.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-02/explain_object_constructor-02.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-02/explain_object_constructor-02.1.adm
new file mode 100644
index 0000000..c637d87
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-02/explain_object_constructor-02.1.adm
@@ -0,0 +1,8 @@
+distribute result [$$2]
+-- DISTRIBUTE_RESULT  |UNPARTITIONED|
+  exchange
+  -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
+    assign [$$2] <- [{ a: "1" }]
+    -- ASSIGN  |UNPARTITIONED|
+      empty-tuple-source
+      -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-03/explain_object_constructor-03.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-03/explain_object_constructor-03.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-03/explain_object_constructor-03.1.adm
new file mode 100644
index 0000000..83a9af1
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_object_constructor-03/explain_object_constructor-03.1.adm
@@ -0,0 +1,8 @@
+distribute result [$$2]
+-- DISTRIBUTE_RESULT  |UNPARTITIONED|
+  exchange
+  -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
+    assign [$$2] <- [{  }]
+    -- ASSIGN  |UNPARTITIONED|
+      empty-tuple-source
+      -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_simple/explain_simple.1.adm
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_simple/explain_simple.1.adm b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_simple/explain_simple.1.adm
index d3b66a5..ad872a1 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_simple/explain_simple.1.adm
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/results/explain/explain_simple/explain_simple.1.adm
@@ -1,9 +1,8 @@
-distribute result [%0->$$2]
+distribute result [$$2]
 -- DISTRIBUTE_RESULT  |UNPARTITIONED|
   exchange
   -- ONE_TO_ONE_EXCHANGE  |UNPARTITIONED|
-    assign [$$2] <- [AInt64: {2}]
+    assign [$$2] <- [2]
     -- ASSIGN  |UNPARTITIONED|
       empty-tuple-source
       -- EMPTY_TUPLE_SOURCE  |UNPARTITIONED|
-

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
index cf1ea5b..3931601 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -137,6 +137,31 @@
         <output-dir compare="Text">explain_simple</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_object_constructor-01">
+        <output-dir compare="Text">explain_object_constructor-01</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_object_constructor-02">
+        <output-dir compare="Text">explain_object_constructor-02</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_object_constructor-03">
+        <output-dir compare="Text">explain_object_constructor-03</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_field_access">
+        <output-dir compare="Text">explain_field_access</output-dir>
+      </compilation-unit>
+    </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_field_access_closed">
+        <output-dir compare="Text">explain_field_access_closed</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-case FilePath="flwor">
     <compilation-unit name="let33">

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
index 702cb0a..aeed05d 100644
--- a/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
+++ b/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/exceptions/ErrorCode.java
@@ -130,9 +130,6 @@ public class ErrorCode {
     public static final int NODE_RESOLVER_UNABLE_RESOLVE_HOST = 3032;
     public static final int INPUT_RECORD_CONVERTER_DCP_MSG_TO_RECORD_CONVERTER_UNKNOWN_DCP_REQUEST = 3033;
     public static final int FEED_DATAFLOW_FRAME_DISTR_REGISTER_FAILED_DATA_PROVIDER = 3034;
-    public static final int FEED_MANAGEMENT_FEED_EVENTS_LISTENER_ALREADY_HAVE_INTAKE_JOB = 3035;
-    public static final int FEED_MANAGEMENT_FEED_EVENTS_LISTENER_INTAKE_JOB_REGISTERED = 3036;
-    public static final int FEED_MANAGEMENT_FEED_EVENTS_LISTENER_FEED_JOB_REGISTERED = 3037;
     public static final int INPUT_RECORD_READER_CHAR_ARRAY_RECORD_TOO_LARGE = 3038;
     public static final int LIBRARY_JOBJECT_ACCESSOR_CANNOT_PARSE_TYPE = 3039;
     public static final int LIBRARY_JOBJECT_UTIL_ILLEGAL_ARGU_TYPE = 3040;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DataSourceId.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DataSourceId.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DataSourceId.java
index d4329a3..0c3f942 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DataSourceId.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/declared/DataSourceId.java
@@ -19,8 +19,6 @@
 
 package org.apache.asterix.metadata.declared;
 
-import java.io.File;
-
 public class DataSourceId {
 
     private String dataverseName;
@@ -33,7 +31,7 @@ public class DataSourceId {
 
     @Override
     public String toString() {
-        return dataverseName + File.pathSeparator + datasourceName;
+        return dataverseName + "." + datasourceName;
     }
 
     public String getDataverseName() {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalScalarFunctionInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalScalarFunctionInfo.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalScalarFunctionInfo.java
index 97211f6..8625756 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalScalarFunctionInfo.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/functions/ExternalScalarFunctionInfo.java
@@ -35,8 +35,4 @@ public class ExternalScalarFunctionInfo extends ExternalFunctionInfo {
         super(namespace, name, arity , FunctionKind.SCALAR, argumentTypes, returnType, rtc, body, language);
     }
 
-    public ExternalScalarFunctionInfo() {
-        super();
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABinary.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABinary.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABinary.java
index d4b7ac7..4bcd4c9 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABinary.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABinary.java
@@ -18,9 +18,10 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
@@ -95,14 +96,10 @@ public class ABinary implements IAObject {
     public String toString() {
         StringBuilder sb = new StringBuilder();
         int start = getStart();
-        sb.append("ABinary: [ ");
+        sb.append("0b");
         for (int i = 0; i < getLength(); i++) {
-            if (i > 0) {
-                sb.append(", ");
-            }
             sb.append(bytes[start + i]);
         }
-        sb.append(" ]");
         return sb.toString();
 
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABitArray.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABitArray.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABitArray.java
deleted file mode 100644
index d3dbe42..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABitArray.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 at
- *
- *   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 org.apache.asterix.om.base;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ArrayNode;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import org.apache.asterix.om.types.BuiltinType;
-import org.apache.asterix.om.types.IAType;
-
-public final class ABitArray implements IAObject {
-
-    private int numberOfBits;
-    private int[] intArray;
-
-    public ABitArray(int nBits) {
-        numberOfBits = nBits;
-        intArray = new int[nBits / 32 + 1];
-    }
-
-    public int[] getIntArray() {
-        return intArray;
-    }
-
-    public final boolean get(int index) {
-        int r = index % 32;
-        int q = index / 32;
-        int p = 1 << r;
-        return (intArray[q] & p) != 0;
-    }
-
-    public final int numberOfBits() {
-        return this.numberOfBits;
-    }
-
-    public final void set(int index, boolean value) {
-        int r = index % 32;
-        int q = index / 32;
-        int p = 1 << r;
-        if (value) {
-            intArray[q] |= p;
-        } else {
-            p = ~p;
-            intArray[q] &= p;
-        }
-    }
-
-    public final void setBit(int index) {
-        set(index, true);
-    }
-
-    public IAType getType() {
-        return BuiltinType.ABITARRAY;
-    }
-
-    public void or(ABitArray bitArray) {
-        int n2 = bitArray.numberOfBits();
-        int[] a2 = bitArray.getIntArray();
-        int q = n2 / 32;
-        for (int i = 0; i < q; i++) {
-            this.intArray[i] |= a2[i];
-        }
-        int r = n2 % 32;
-        if (r > 0) {
-            int mask = 0;
-            for (int i = 0; i < r; i++) {
-                mask = (mask << 1) + 1;
-            }
-            this.intArray[q] |= a2[q] & mask;
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        int h = 0;
-        for (int i = 0; i < intArray.length; i++) {
-            h = h * 31 + intArray[i];
-        }
-        return h;
-    }
-
-    @Override
-    public boolean deepEqual(IAObject obj) {
-        if (!(obj instanceof ABitArray)) {
-            return false;
-        }
-        int[] x = ((ABitArray) obj).getIntArray();
-        if (intArray.length != x.length) {
-            return false;
-        }
-        for (int k = 0; k < intArray.length; k++) {
-            if (intArray[k] != x[k]) {
-                return false;
-            }
-        }
-        return true;
-    }
-
-    @Override
-    public int hash() {
-        return hashCode();
-    }
-
-    @Override
-    public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("ABitArray: [ ");
-        for (int i = 0; i < intArray.length; i++) {
-            if (i > 0) {
-                sb.append(", ");
-            }
-            sb.append(intArray[i]);
-        }
-        sb.append(" ]");
-        return sb.toString();
-    }
-
-    @Override
-    public ObjectNode toJSON()  {
-        ObjectMapper om = new ObjectMapper();
-        ObjectNode json = om.createObjectNode();
-
-        ArrayNode bitArray = om.createArrayNode();
-        for (int i = 0; i < intArray.length; i++) {
-            bitArray.add(intArray[i]);
-        }
-        json.set("ABitArray", bitArray);
-
-        return json;
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABoolean.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABoolean.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABoolean.java
index 8b24205..a0c572c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABoolean.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ABoolean.java
@@ -18,9 +18,10 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public final class ABoolean implements IAObject {
@@ -49,7 +50,7 @@ public final class ABoolean implements IAObject {
 
     @Override
     public String toString() {
-        return "ABoolean: {" + bVal + "}";
+        return Boolean.toString(bVal).toUpperCase();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACircle.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACircle.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACircle.java
index 43f9109..9c2369d 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACircle.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACircle.java
@@ -18,12 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class ACircle implements IAObject {
 
     protected APoint center;
@@ -71,7 +71,7 @@ public class ACircle implements IAObject {
 
     @Override
     public String toString() {
-        return "ACircle: { center: " + center + ", radius: " + radius + "}";
+        return "circle: { \"center\": " + center + ", \"radius\":" + radius + "}";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACollectionCursor.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACollectionCursor.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACollectionCursor.java
index e57d534..c65cb78 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACollectionCursor.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ACollectionCursor.java
@@ -27,17 +27,6 @@ public class ACollectionCursor implements IACursor {
     private int size;
     private IAObject object = null;
 
-    public ACollectionCursor() {
-    }
-
-    public ACollectionCursor(AUnorderedList bag) {
-        reset(bag);
-    }
-
-    public ACollectionCursor(AOrderedList list) {
-        reset(list);
-    }
-
     @Override
     public boolean next() {
         pos++;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADate.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADate.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADate.java
index 4bd6711..3d7639e 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADate.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADate.java
@@ -20,13 +20,13 @@ package org.apache.asterix.om.base;
 
 import java.io.IOException;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 /**
  * ADate type represents dates in a gregorian calendar system.
  */
@@ -73,7 +73,7 @@ public class ADate implements IAObject {
     @Override
     public String toString() {
         StringBuilder sbder = new StringBuilder();
-        sbder.append("ADate: { ");
+        sbder.append("\"date\": { ");
         try {
             GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(chrononTimeInDay * CHRONON_OF_DAY, 0,
                     sbder, GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.DAY, false);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADateTime.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADateTime.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADateTime.java
index ab228a2..cf6fff0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADateTime.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADateTime.java
@@ -20,10 +20,11 @@ package org.apache.asterix.om.base;
 
 import java.io.IOException;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 /**
@@ -106,7 +107,7 @@ public class ADateTime implements IAObject {
     @Override
     public String toString() {
         StringBuilder sbder = new StringBuilder();
-        sbder.append("ADateTime: { ");
+        sbder.append("datetime: { ");
         try {
             GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(chrononTime, 0, sbder,
                     GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.MILLISECOND, true);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
index 7cb4151..4c307f4 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADouble.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class ADouble implements IAObject {
 
     protected double value;
@@ -45,7 +44,7 @@ public class ADouble implements IAObject {
 
     @Override
     public String toString() {
-        return "ADouble: {" + value + "}";
+        return Double.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADuration.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADuration.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADuration.java
index 3753930..618f130 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADuration.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ADuration.java
@@ -18,14 +18,13 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 /**
  * ADuration type represents time duration (unanchored time length) values.
  * <p/>
@@ -103,7 +102,7 @@ public class ADuration implements IAObject {
     @Override
     public String toString() {
         StringBuilder sbder = new StringBuilder();
-        sbder.append("ADuration: {");
+        sbder.append("duration: {");
         GregorianCalendarSystem.getInstance().getDurationExtendStringRepWithTimezoneUntilField(chrononInMillisecond,
                 chrononInMonth, sbder);
         sbder.append(" }");

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
index 3794747..4ad1b50 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AFloat.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AFloat implements IAObject {
 
     protected float value;
@@ -68,7 +67,7 @@ public class AFloat implements IAObject {
 
     @Override
     public String toString() {
-        return "AFloat: {" + value + "}";
+        return Float.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt16.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt16.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt16.java
index 392aae7..65c53ac 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt16.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt16.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AInt16 implements IAObject {
 
     protected short value;
@@ -58,7 +57,7 @@ public class AInt16 implements IAObject {
 
     @Override
     public String toString() {
-        return "AInt16: {" + value + "}";
+        return Short.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt32.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt32.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt32.java
index 495a604..e0ecbb0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt32.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt32.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AInt32 implements IAObject {
 
     protected int value;
@@ -49,7 +48,7 @@ public class AInt32 implements IAObject {
 
     @Override
     public String toString() {
-        return "AInt32: {" + value + "}";
+        return Integer.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt64.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt64.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt64.java
index 3cf40d6..e0369a2 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt64.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt64.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AInt64 implements IAObject {
 
     protected long value;
@@ -57,7 +56,7 @@ public class AInt64 implements IAObject {
 
     @Override
     public String toString() {
-        return "AInt64: {" + value + "}";
+        return Long.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt8.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt8.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt8.java
index a435833..c18e878 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt8.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInt8.java
@@ -18,13 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AInt8 implements IAObject {
 
     protected byte value;
@@ -57,7 +56,7 @@ public class AInt8 implements IAObject {
 
     @Override
     public String toString() {
-        return "AInt8: {" + value + "}";
+        return Byte.toString(value);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInterval.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInterval.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInterval.java
index b5d40c0..2d54786 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInterval.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AInterval.java
@@ -20,13 +20,13 @@ package org.apache.asterix.om.base;
 
 import java.io.IOException;
 
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class AInterval implements IAObject {
 
     protected long intervalStart;
@@ -94,33 +94,33 @@ public class AInterval implements IAObject {
     @Override
     public String toString() {
         StringBuilder sbder = new StringBuilder();
-        sbder.append("AInterval: { ");
+        sbder.append("interval: { ");
         try {
             if (typetag == ATypeTag.DATE.serialize()) {
-                sbder.append("ADate: { ");
+                sbder.append("date: { ");
 
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(
                         intervalStart * ADate.CHRONON_OF_DAY, 0, sbder, GregorianCalendarSystem.Fields.YEAR,
                         GregorianCalendarSystem.Fields.DAY, false);
 
-                sbder.append(" }, ADate: {");
+                sbder.append(" }, date: {");
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(intervalEnd * ADate.CHRONON_OF_DAY,
                         0, sbder, GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.DAY, false);
                 sbder.append(" }");
             } else if (typetag == ATypeTag.TIME.serialize()) {
-                sbder.append("ATime: { ");
+                sbder.append("time: { ");
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(intervalStart, 0, sbder,
                         GregorianCalendarSystem.Fields.HOUR, GregorianCalendarSystem.Fields.MILLISECOND, true);
-                sbder.append(" }, ATime: { ");
+                sbder.append(" }, time: { ");
 
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(intervalEnd, 0, sbder,
                         GregorianCalendarSystem.Fields.HOUR, GregorianCalendarSystem.Fields.MILLISECOND, true);
                 sbder.append(" }");
             } else if (typetag == ATypeTag.DATETIME.serialize()) {
-                sbder.append("ADateTime: { ");
+                sbder.append("datetime: { ");
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(intervalStart, 0, sbder,
                         GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.MILLISECOND, true);
-                sbder.append(" }, ADateTime: { ");
+                sbder.append(" }, datetime: { ");
                 GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(intervalEnd, 0, sbder,
                         GregorianCalendarSystem.Fields.YEAR, GregorianCalendarSystem.Fields.MILLISECOND, true);
                 sbder.append(" }");

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ALine.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ALine.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ALine.java
index e1cf6ff..67ae2d5 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ALine.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ALine.java
@@ -18,12 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class ALine implements IAObject {
 
     protected APoint p1;
@@ -64,7 +64,7 @@ public class ALine implements IAObject {
 
     @Override
     public String toString() {
-        return "ALine: { p1: " + p1 + ", p2: " + p2 + "}";
+        return "line: { p1: " + p1 + ", p2: " + p2 + "}";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AOrderedList.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AOrderedList.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AOrderedList.java
index 9a5a147..3c1a165 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AOrderedList.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AOrderedList.java
@@ -21,10 +21,11 @@ package org.apache.asterix.om.base;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.AOrderedListType;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
@@ -104,7 +105,7 @@ public class AOrderedList implements IACollection {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("AOrderedList: [ ");
+        sb.append("array: [ ");
         boolean first = true;
         for (IAObject v : values) {
             if (first) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint.java
index 543edfb..66e96f0 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint.java
@@ -18,12 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class APoint implements IAObject {
 
     protected double x;
@@ -64,7 +64,7 @@ public class APoint implements IAObject {
 
     @Override
     public String toString() {
-        return "APoint: { x: " + x + ", y: " + y + " }";
+        return "point: { x: " + x + ", y: " + y + " }";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint3D.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint3D.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint3D.java
index 94876b5..9a4a06e 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint3D.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APoint3D.java
@@ -18,12 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class APoint3D implements IAObject {
 
     protected double x;
@@ -70,7 +70,7 @@ public class APoint3D implements IAObject {
 
     @Override
     public String toString() {
-        return "APoint3D: { x: " + x + ", y: " + y + ", z: " + z + " }";
+        return "point3d: { x: " + x + ", y: " + y + ", z: " + z + " }";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APolygon.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APolygon.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APolygon.java
index 8c31c76..eb4f1b4 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APolygon.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/APolygon.java
@@ -18,13 +18,13 @@
  */
 package org.apache.asterix.om.base;
 
+import org.apache.asterix.om.types.BuiltinType;
+import org.apache.asterix.om.types.IAType;
+
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
-import org.apache.asterix.om.types.BuiltinType;
-import org.apache.asterix.om.types.IAType;
-
 public class APolygon implements IAObject {
 
     protected APoint[] points;
@@ -76,7 +76,7 @@ public class APolygon implements IAObject {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("APolygon: [ ");
+        sb.append("polygon: [ ");
         for (int i = 0; i < points.length; i++) {
             if (i > 0) {
                 sb.append(", ");

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARecord.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARecord.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARecord.java
index 352f2eb..aed969c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARecord.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARecord.java
@@ -18,11 +18,11 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.ARecordType;
 import org.apache.asterix.om.utils.RecordUtil;
-import com.fasterxml.jackson.databind.node.ArrayNode;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public class ARecord implements IAObject {
@@ -83,7 +83,7 @@ public class ARecord implements IAObject {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("ARecord: { ");
+        sb.append("{ ");
         if (fields != null) {
             for (int i = 0; i < fields.length; i++) {
                 if (i > 0) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARectangle.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARectangle.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARectangle.java
index c99bc9b..d6da9e5 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARectangle.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ARectangle.java
@@ -18,12 +18,12 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class ARectangle implements IAObject {
 
     protected APoint p1;
@@ -64,7 +64,7 @@ public class ARectangle implements IAObject {
 
     @Override
     public String toString() {
-        return "ARectangle: { p1: " + p1 + ", p2: " + p2 + "}";
+        return "rectangle: { p1: " + p1 + ", p2: " + p2 + "}";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AString.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AString.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AString.java
index 4efd63a..aefe5f7 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AString.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AString.java
@@ -20,10 +20,10 @@ package org.apache.asterix.om.base;
 
 import java.io.Serializable;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public class AString implements IAObject, Serializable {
@@ -45,7 +45,7 @@ public class AString implements IAObject, Serializable {
 
     @Override
     public String toString() {
-        return "AString: {" + value + "}";
+        return "\"" + value + "\"";
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ATime.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ATime.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ATime.java
index 38d22bc..a14d386 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ATime.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ATime.java
@@ -20,13 +20,13 @@ package org.apache.asterix.om.base;
 
 import java.io.IOException;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
 import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 public class ATime implements IAObject {
 
     /**
@@ -88,7 +88,7 @@ public class ATime implements IAObject {
     @Override
     public String toString() {
         StringBuilder sbder = new StringBuilder();
-        sbder.append("ATime: { ");
+        sbder.append("time: { ");
         try {
             GregorianCalendarSystem.getInstance().getExtendStringRepUntilField(chrononTime, 0, sbder,
                     GregorianCalendarSystem.Fields.HOUR, GregorianCalendarSystem.Fields.MILLISECOND, true);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUUID.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUUID.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUUID.java
index c0d27ce..0ed9d3f 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUUID.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUUID.java
@@ -24,10 +24,11 @@ import java.io.DataOutput;
 import java.io.IOException;
 import java.util.Arrays;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 import org.apache.hyracks.api.exceptions.HyracksDataException;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
 public class AUUID implements IAObject {
@@ -84,13 +85,8 @@ public class AUUID implements IAObject {
     @Override
     public String toString() {
         StringBuilder buf = new StringBuilder(UUID_CHARS + 9);
-        buf.append("AUUID: {");
-        return appendLiteralOnly(buf).append('}').toString();
-    }
-
-    public String toSimpleString() {
-        StringBuilder buf = new StringBuilder(UUID_CHARS + 9);
-        return appendLiteralOnly(buf).toString();
+        buf.append("uuid: { ");
+        return appendLiteralOnly(buf).append(" }").toString();
     }
 
     public StringBuilder appendLiteralOnly(StringBuilder buf) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUnorderedList.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUnorderedList.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUnorderedList.java
index cac0840..894421c 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUnorderedList.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AUnorderedList.java
@@ -21,9 +21,10 @@ package org.apache.asterix.om.base;
 import java.util.ArrayList;
 import java.util.List;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
 import org.apache.asterix.om.types.AUnorderedListType;
 import org.apache.asterix.om.types.IAType;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.node.ArrayNode;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 
@@ -33,7 +34,7 @@ public class AUnorderedList implements IACollection {
     protected AUnorderedListType type;
 
     public AUnorderedList(AUnorderedListType type) {
-        values = new ArrayList<IAObject>();
+        values = new ArrayList<>();
         this.type = type;
     }
 
@@ -74,14 +75,6 @@ public class AUnorderedList implements IACollection {
         return values.size();
     }
 
-    public IAObject getOneObject() {
-        if (values == null || values.isEmpty()) {
-            return null;
-        } else {
-            return values.get(0);
-        }
-    }
-
     @Override
     public boolean deepEqual(IAObject obj) {
         return equals(obj);
@@ -95,7 +88,7 @@ public class AUnorderedList implements IACollection {
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
-        sb.append("AUnorderedList: [ ");
+        sb.append("multiset: {{ ");
         boolean first = true;
         for (IAObject v : values) {
             if (first) {
@@ -105,7 +98,7 @@ public class AUnorderedList implements IACollection {
             }
             sb.append(v.toString());
         }
-        sb.append(" ]");
+        sb.append(" }}");
         return sb.toString();
     }
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AYearMonthDuration.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AYearMonthDuration.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AYearMonthDuration.java
index 55982e1..8321848 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AYearMonthDuration.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/AYearMonthDuration.java
@@ -18,13 +18,13 @@
  */
 package org.apache.asterix.om.base;
 
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
+import org.apache.asterix.om.base.temporal.GregorianCalendarSystem;
 import org.apache.asterix.om.types.BuiltinType;
 import org.apache.asterix.om.types.IAType;
 
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.node.ObjectNode;
+
 /**
  * AYearMonthDuration represents the duration in the unit of months.
  * <p/>
@@ -45,9 +45,15 @@ public class AYearMonthDuration implements IAObject {
         return chrononInMonth;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.hyracks.api.dataflow.value.JSONSerializable#toJSON()
-     */
+    @Override
+    public String toString() {
+        StringBuilder sbder = new StringBuilder();
+        sbder.append("year_month_duration: {");
+        GregorianCalendarSystem.getInstance().getDurationMonth(chrononInMonth);
+        sbder.append(" }");
+        return sbder.toString();
+    }
+
     @Override
     public ObjectNode toJSON()  {
         ObjectMapper om = new ObjectMapper();
@@ -60,25 +66,16 @@ public class AYearMonthDuration implements IAObject {
         return json;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.asterix.om.base.IAObject#getType()
-     */
     @Override
     public IAType getType() {
         return BuiltinType.AYEARMONTHDURATION;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.asterix.om.base.IAObject#deepEqual(org.apache.asterix.om.base.IAObject)
-     */
     @Override
     public boolean deepEqual(IAObject obj) {
         return equals(obj);
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.asterix.om.base.IAObject#hash()
-     */
     @Override
     public int hash() {
         return hashCode();

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ShortWithoutTypeInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ShortWithoutTypeInfo.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ShortWithoutTypeInfo.java
deleted file mode 100644
index 4ed7966..0000000
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/base/ShortWithoutTypeInfo.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you 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 at
- *
- *   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 org.apache.asterix.om.base;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.node.ObjectNode;
-
-import org.apache.asterix.om.types.BuiltinType;
-import org.apache.asterix.om.types.IAType;
-
-public class ShortWithoutTypeInfo implements IAObject {
-
-    protected short value;
-
-    public ShortWithoutTypeInfo(short value) {
-        super();
-        this.value = value;
-    }
-
-    public ShortWithoutTypeInfo(byte[] bytes, int offset, int length) {
-        value = valueFromBytes(bytes, offset, length);
-    }
-
-    public Short getShortValue() {
-        return value;
-    }
-
-    @Override
-    public IAType getType() {
-        return BuiltinType.SHORTWITHOUTTYPEINFO;
-    }
-
-    @Override
-    public String toString() {
-        return "ShortWithoutTypeInfo: {" + value + "}";
-    }
-
-    @Override
-    public boolean equals(Object obj) {
-        if (!(obj instanceof ShortWithoutTypeInfo)) {
-            return false;
-        } else {
-            return value == (((ShortWithoutTypeInfo) obj).getShortValue());
-        }
-    }
-
-    @Override
-    public int hashCode() {
-        return value;
-    }
-
-    private static short valueFromBytes(byte[] bytes, int offset, int length) {
-        return (short) (((bytes[offset] & 0xff) << 8) + ((bytes[offset + 1] & 0xff)));
-    }
-
-    public byte[] toBytes() {
-        return new byte[] { (byte) ((value >>> 8) & 0xff), (byte) ((value >>> 0) & 0xff)};
-    }
-
-    @Override
-    public boolean deepEqual(IAObject obj) {
-        return equals(obj);
-    }
-
-    @Override
-    public int hash() {
-        return hashCode();
-    }
-
-    @Override
-    public ObjectNode toJSON()  {
-        ObjectMapper om = new ObjectMapper();
-        ObjectNode json = om.createObjectNode();
-
-        json.put("ShortWithoutTypeInfo", value);
-
-        return json;
-    }
-}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/ExternalFunctionInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/ExternalFunctionInfo.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/ExternalFunctionInfo.java
index 9f3b529..0042b26 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/ExternalFunctionInfo.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/ExternalFunctionInfo.java
@@ -35,17 +35,6 @@ public class ExternalFunctionInfo extends FunctionInfo implements IExternalFunct
     private final FunctionKind kind;
     private final IAType returnType;
 
-    public ExternalFunctionInfo() {
-        super();
-        rtc = null;
-        argumentTypes = null;
-        body = null;
-        language = null;
-        kind = null;
-        returnType = null;
-
-    }
-
     public ExternalFunctionInfo(String namespace, String name, int arity, FunctionKind kind,
             List<IAType> argumentTypes, IAType returnType, IResultTypeComputer rtc, String body, String language) {
         super(namespace, name, arity, true);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionDisplayUtil.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionDisplayUtil.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionDisplayUtil.java
new file mode 100644
index 0000000..a1b81f0
--- /dev/null
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionDisplayUtil.java
@@ -0,0 +1,110 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you 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 at
+ *
+ *    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 org.apache.asterix.om.functions;
+
+import java.util.List;
+
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
+
+class FunctionDisplayUtil {
+
+    @FunctionalInterface
+    interface DefaultDisplayFunction {
+        String display(List<Mutable<ILogicalExpression>> args);
+    }
+
+    private FunctionDisplayUtil() {
+        // Does nothing.
+    }
+
+    /**
+     * Displays a function with its parameters in a user-friendly way.
+     *
+     * @param functionInfo,
+     *            the function info.
+     * @param args
+     *            , the arguments in the function call expression.
+     * @param defaultDisplayFunction,
+     *            the default display function for regular functions.
+     * @return the display string of the function call expression.
+     */
+    public static String display(IFunctionInfo functionInfo, List<Mutable<ILogicalExpression>> args,
+            DefaultDisplayFunction defaultDisplayFunction) {
+        FunctionIdentifier funcId = functionInfo.getFunctionIdentifier();
+        if (funcId.equals(BuiltinFunctions.FIELD_ACCESS_BY_INDEX)) {
+            return displayFieldAccess(args, true);
+        } else if (funcId.equals(BuiltinFunctions.FIELD_ACCESS_BY_NAME)
+                || funcId.equals(BuiltinFunctions.FIELD_ACCESS_NESTED)) {
+            return displayFieldAccess(args, false);
+        } else if (funcId.equals(BuiltinFunctions.OPEN_RECORD_CONSTRUCTOR)
+                || funcId.equals(BuiltinFunctions.CLOSED_RECORD_CONSTRUCTOR)) {
+            return displayRecordConstructor(args);
+        }
+        return defaultDisplayFunction.display(args);
+    }
+
+    // Displays field-access-by-index in an easy-to-understand way.
+    private static String displayFieldAccess(List<Mutable<ILogicalExpression>> args, boolean intArg) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        boolean second = true;
+        for (Mutable<ILogicalExpression> ref : args) {
+            if (first) {
+                first = false;
+            } else if (second) {
+                sb.append(".getField(" + (intArg ? "" : "\""));
+                second = false;
+            } else {
+                sb.append(".");
+            }
+            sb.append(ref.getValue().toString().replaceAll("^\"|\"$", ""));
+        }
+        sb.append((intArg ? "" : "\"") + ")");
+        return sb.toString();
+    }
+
+    // Displays record-constructor in an easy-to-understand way.
+    private static String displayRecordConstructor(List<Mutable<ILogicalExpression>> args) {
+        StringBuilder sb = new StringBuilder();
+        boolean first = true;
+        boolean fieldName = true;
+        sb.append("{");
+        for (Mutable<ILogicalExpression> ref : args) {
+            if (first) {
+                first = false;
+            } else if (fieldName) {
+                sb.append(", ");
+            }
+            sb.append(ref.getValue());
+            if (fieldName) {
+                sb.append(": ");
+                fieldName = false;
+            } else {
+                fieldName = true;
+            }
+        }
+        sb.append("}");
+        return sb.toString();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionInfo.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionInfo.java
index 7a590a7..994b2a9 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionInfo.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/FunctionInfo.java
@@ -18,43 +18,48 @@
  */
 package org.apache.asterix.om.functions;
 
-import org.apache.asterix.common.functions.FunctionSignature;
-import org.apache.hyracks.algebricks.core.algebra.functions.AbstractFunctionInfo;
-import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import java.util.List;
 
-public class FunctionInfo extends AbstractFunctionInfo {
+import org.apache.commons.lang3.mutable.Mutable;
+import org.apache.hyracks.algebricks.core.algebra.base.ILogicalExpression;
+import org.apache.hyracks.algebricks.core.algebra.functions.FunctionIdentifier;
+import org.apache.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
 
-    private static final long serialVersionUID = 1L;
+public class FunctionInfo implements IFunctionInfo {
 
     private final FunctionIdentifier functionIdentifier;
+    private final boolean isFunctional;
 
     public FunctionInfo(String namespace, String name, int arity, boolean isFunctional) {
-        super(isFunctional);
-        this.functionIdentifier = new FunctionIdentifier(namespace, name, arity);
-    }
-
-    public FunctionInfo() {
-        super(true);
-        functionIdentifier = null;
+        this(new FunctionIdentifier(namespace, name, arity), isFunctional);
     }
 
     public FunctionInfo(FunctionIdentifier functionIdentifier, boolean isFunctional) {
-        super(isFunctional);
+        this.isFunctional = isFunctional;
         this.functionIdentifier = functionIdentifier;
     }
 
-    public FunctionInfo(FunctionSignature functionSignature, boolean isFunctional) {
-        super(isFunctional);
-        this.functionIdentifier = new FunctionIdentifier(functionSignature.getNamespace(), functionSignature.getName(),
-                functionSignature.getArity());
-    }
-
     @Override
     public FunctionIdentifier getFunctionIdentifier() {
         return functionIdentifier;
     }
 
     @Override
+    public boolean isFunctional() {
+        return isFunctional;
+    }
+
+    /**
+     * @param args,
+     *            the arguments.
+     * @return a display string of the FunctionInfo.
+     */
+    @Override
+    public String display(List<Mutable<ILogicalExpression>> args) {
+        return FunctionDisplayUtil.display(this, args, input -> IFunctionInfo.super.display(input));
+    }
+
+    @Override
     public int hashCode() {
         return toString().hashCode();
     }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/IExternalFunctionInfo.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/IExternalFunctionInfo.java b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/IExternalFunctionInfo.java
index 070fa97..d2d6339 100644
--- a/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/IExternalFunctionInfo.java
+++ b/asterixdb/asterix-om/src/main/java/org/apache/asterix/om/functions/IExternalFunctionInfo.java
@@ -18,7 +18,6 @@
  */
 package org.apache.asterix.om.functions;
 
-import java.io.Serializable;
 import java.util.List;
 
 import org.apache.asterix.om.typecomputer.base.IResultTypeComputer;
@@ -26,7 +25,7 @@ import org.apache.asterix.om.types.IAType;
 import org.apache.hyracks.algebricks.core.algebra.expressions.AbstractFunctionCallExpression.FunctionKind;
 import org.apache.hyracks.algebricks.core.algebra.functions.IFunctionInfo;
 
-public interface IExternalFunctionInfo extends IFunctionInfo, Serializable {
+public interface IExternalFunctionInfo extends IFunctionInfo {
 
     public IResultTypeComputer getResultTypeComputer();
 

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IOptimizationContext.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IOptimizationContext.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IOptimizationContext.java
index 328697d..a5b2284 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IOptimizationContext.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IOptimizationContext.java
@@ -67,8 +67,6 @@ public interface IOptimizationContext extends ITypingContext, IVariableContext {
 
     public List<FunctionalDependency> getFDList(ILogicalOperator op);
 
-    public void clearAllFDAndEquivalenceClasses();
-
     public void putLogicalPropertiesVector(ILogicalOperator op, ILogicalPropertiesVector v);
 
     public ILogicalPropertiesVector getLogicalPropertiesVector(ILogicalOperator op);

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IVariableContext.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IVariableContext.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IVariableContext.java
index e308a8d..71d4533 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IVariableContext.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/IVariableContext.java
@@ -20,10 +20,11 @@ package org.apache.hyracks.algebricks.core.algebra.base;
 
 public interface IVariableContext {
 
-    public int getVarCounter();
+    int getVarCounter();
 
-    public void setVarCounter(int varCounter);
+    void setVarCounter(int varCounter);
 
-    public LogicalVariable newVar();
+    LogicalVariable newVar();
 
+    LogicalVariable newVar(String displayName);
 }

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/LogicalVariable.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/LogicalVariable.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/LogicalVariable.java
index fc30ce2..2023304 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/LogicalVariable.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/base/LogicalVariable.java
@@ -25,9 +25,16 @@ package org.apache.hyracks.algebricks.core.algebra.base;
  */
 public final class LogicalVariable {
     private final int id;
+    private final String displayName;
 
     public LogicalVariable(int id) {
         this.id = id;
+        this.displayName = "$$" + id;
+    }
+
+    public LogicalVariable(int id, String displayName) {
+        this.id = id;
+        this.displayName = "$" + displayName;
     }
 
     public int getId() {
@@ -36,7 +43,7 @@ public final class LogicalVariable {
 
     @Override
     public String toString() {
-        return "$$" + id;
+        return displayName;
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
index b35f692..8bc39b8 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AbstractFunctionCallExpression.java
@@ -87,7 +87,7 @@ public abstract class AbstractFunctionCallExpression extends AbstractLogicalExpr
     protected List<Mutable<ILogicalExpression>> cloneArguments() {
         List<Mutable<ILogicalExpression>> clonedArgs = new ArrayList<Mutable<ILogicalExpression>>(arguments.size());
         for (Mutable<ILogicalExpression> e : arguments) {
-            ILogicalExpression e2 = ((AbstractLogicalExpression) e.getValue()).cloneExpression();
+            ILogicalExpression e2 = e.getValue().cloneExpression();
             clonedArgs.add(new MutableObject<ILogicalExpression>(e2));
         }
         return clonedArgs;
@@ -111,20 +111,7 @@ public abstract class AbstractFunctionCallExpression extends AbstractLogicalExpr
 
     @Override
     public String toString() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("function-call: " + finfo.getFunctionIdentifier() + ", Args:[");
-        // + arguments;
-        boolean first = true;
-        for (Mutable<ILogicalExpression> ref : arguments) {
-            if (first) {
-                first = false;
-            } else {
-                sb.append(", ");
-            }
-            sb.append(ref.getValue());
-        }
-        sb.append("]");
-        return sb.toString();
+        return finfo.display(arguments);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/049d5414/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AggregateFunctionCallExpression.java
----------------------------------------------------------------------
diff --git a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AggregateFunctionCallExpression.java b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AggregateFunctionCallExpression.java
index f09b4c2..8fca47c 100644
--- a/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AggregateFunctionCallExpression.java
+++ b/hyracks-fullstack/algebricks/algebricks-core/src/main/java/org/apache/hyracks/algebricks/core/algebra/expressions/AggregateFunctionCallExpression.java
@@ -52,10 +52,6 @@ public class AggregateFunctionCallExpression extends AbstractFunctionCallExpress
         return twoStep;
     }
 
-    public void setTwoStep(boolean twoStep) {
-        this.twoStep = twoStep;
-    }
-
     @Override
     public AggregateFunctionCallExpression cloneExpression() {
         cloneAnnotations();


Mime
View raw message