asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ima...@apache.org
Subject [2/2] incubator-asterixdb git commit: Almost full support for clean JSON, plus some lossless JSON fixes
Date Thu, 08 Oct 2015 16:45:14 GMT
Almost full support for clean JSON, plus some lossless JSON fixes

Clean JSON correctly supports all numeric and spatial types, plus hex and uuid.
Lossless JSON correctly supports uuid and hex, and "circle" is correct now.

Date/time types remain unfixed for both JSON formats.

Change-Id: I5c37d3b5aad7f286eba1cb8cb5f05ad456a6521d
Reviewed-on: https://asterix-gerrit.ics.uci.edu/362
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Chris Hillery <ceej@lambda.nu>


Project: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/commit/7230d632
Tree: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/tree/7230d632
Diff: http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/diff/7230d632

Branch: refs/heads/master
Commit: 7230d632c15650e15be004097c67abf79684a39b
Parents: f4a1c3c
Author: Chris Hillery <chillery@lambda.nu>
Authored: Fri Aug 21 02:24:38 2015 -0700
Committer: Chris Hillery <ceej@lambda.nu>
Committed: Thu Oct 8 01:30:16 2015 -0700

----------------------------------------------------------------------
 asterix-app/data/nontagged/allData.adm          |  25 +++
 asterix-app/data/nontagged/allData.json         |  17 --
 .../scan/alltypes_01/alltypes_01.1.ddl.aql      |  30 ++--
 .../scan/alltypes_02/alltypes_02.1.ddl.aql      |  30 ++--
 .../results/json/int01-cleanjson/int01.1.json   |   8 +-
 .../json/int01-losslessjson/int01.1.json        |   8 +-
 .../alltypes_01-cleanjson/alltypes_01.1.json    |   2 +
 .../alltypes_01-losslessjson/alltypes_01.1.json |   2 +
 .../results/scan/alltypes_01/alltypes_01.1.adm  |   2 +-
 .../results/scan/alltypes_02/alltypes_02.1.adm  |   2 +-
 .../src/test/resources/runtimets/testsuite.xml  |  12 +-
 .../data/nontagged/printers/PrintTools.java     | 169 +++++++++++++++++++
 .../printers/adm/ABinaryHexPrinter.java         |  12 +-
 .../nontagged/printers/adm/AStringPrinter.java  |   1 +
 .../data/nontagged/printers/adm/PrintTools.java | 159 -----------------
 .../nontagged/printers/csv/AStringPrinter.java  |   2 +-
 .../printers/json/clean/ABinaryHexPrinter.java  |  52 ++++++
 .../json/clean/ABinaryPrinterFactory.java       |  35 ++++
 .../printers/json/clean/ACirclePrinter.java     |   8 +-
 .../printers/json/clean/AInt16Printer.java      |   5 +-
 .../printers/json/clean/AInt32Printer.java      |   5 +-
 .../printers/json/clean/AInt64Printer.java      |   4 +-
 .../printers/json/clean/AInt8Printer.java       |   5 +-
 .../printers/json/clean/ALinePrinter.java       |   7 +-
 .../printers/json/clean/AObjectPrinter.java     |   6 +-
 .../printers/json/clean/APoint3DPrinter.java    |   4 +-
 .../printers/json/clean/APointPrinter.java      |   4 +-
 .../printers/json/clean/APolygonPrinter.java    |  10 +-
 .../printers/json/clean/ARectanglePrinter.java  |   7 +-
 .../printers/json/clean/AStringPrinter.java     |   2 +-
 .../printers/json/clean/AUUIDPrinter.java       |  48 ++++++
 .../json/clean/AUUIDPrinterFactory.java         |  37 ++++
 .../json/lossless/ABinaryHexPrinter.java        |  51 ++++++
 .../json/lossless/ABinaryPrinterFactory.java    |  35 ++++
 .../printers/json/lossless/ACirclePrinter.java  |   8 +-
 .../printers/json/lossless/AInt16Printer.java   |   6 +-
 .../printers/json/lossless/AInt32Printer.java   |   6 +-
 .../printers/json/lossless/AInt64Printer.java   |   6 +-
 .../printers/json/lossless/AInt8Printer.java    |   6 +-
 .../printers/json/lossless/AObjectPrinter.java  |   6 +-
 .../printers/json/lossless/AStringPrinter.java  |   2 +-
 .../printers/json/lossless/AUUIDPrinter.java    |  48 ++++++
 .../json/lossless/AUUIDPrinterFactory.java      |  37 ++++
 .../AqlCleanJSONPrinterFactoryProvider.java     |   2 +-
 .../AqlLosslessJSONPrinterFactoryProvider.java  |   2 +-
 .../printer/json/clean/APrintVisitor.java       |  12 +-
 .../printer/json/lossless/APrintVisitor.java    |  12 +-
 .../functions/binary/PrintBinaryDescriptor.java |   4 +-
 48 files changed, 661 insertions(+), 302 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/data/nontagged/allData.adm
----------------------------------------------------------------------
diff --git a/asterix-app/data/nontagged/allData.adm b/asterix-app/data/nontagged/allData.adm
new file mode 100644
index 0000000..da13528
--- /dev/null
+++ b/asterix-app/data/nontagged/allData.adm
@@ -0,0 +1,25 @@
+{ "id": 10,
+"string": string("Nancy"),
+"float": 32.5f,
+"double" : double("-2013.5938237483274"),
+"boolean" : true,
+"int8": int8("125"),
+"int16": int16("32765"),
+"int32": int32("294967295"),
+"int64": int64("1700000000000000000"),
+"unorderedList": {{"reading","writing"}},
+"orderedList": ["Brad","Scott"],
+"record": {  "number": 8389, "street": "Hill St.", "city": "Mountain View" },
+"date": date("-2011-01-27"),
+"time": time("12:20:30Z"),
+"datetime": datetime("-1951-12-27T12:20:30"),
+"duration": duration("P10Y11M12DT10H50M30S"),
+"point": point("41.00,44.00"),
+"point3d": point3d("44.00,13.00,41.00"),
+"line" : line("10.1,11.1 10.2,11.2"),
+"rectangle" : rectangle("5.1,11.8 87.6,15.6548"),
+"polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"),
+"circle" : circle("10.1,11.1 10.2"),
+"binary" : hex("ABCDEF0123456789"),
+"uuid" : uuid("5c848e5c-6b6a-498f-8452-8847a2957421")
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/data/nontagged/allData.json
----------------------------------------------------------------------
diff --git a/asterix-app/data/nontagged/allData.json b/asterix-app/data/nontagged/allData.json
deleted file mode 100644
index 06c786f..0000000
--- a/asterix-app/data/nontagged/allData.json
+++ /dev/null
@@ -1,17 +0,0 @@
-{ "id": 10,
-"name": string("Nancy"),
-"age": 32.5f,
-"salary": 12.000 ,"married": boolean("true"),
-"interests": {{"reading","writing"}},
-"children": ["Brad","Scott"],
- "address": {  "number": 8389, "street": "Hill St.", "city": "Mountain View" },
-"dob": date("-2011-01-27"),
-"time": time("12:20:30Z"),
-"datetime": datetime("-1951-12-27T12:20:30"),
- "duration": duration("P10Y11M12DT10H50M30S"),
- "location2d": point("41.00,44.00"),
- "location3d": point3d("44.00,13.00,41.00"),
-"line" : line("10.1,11.1 10.2,11.2"),
-"polygon" : polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"),
-"circle" : circle("10.1,11.1 10.2"),
-"binary" : hex("ABCDEF0123456789") }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
index 771b13e..4515e02 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_01/alltypes_01.1.ddl.aql
@@ -29,26 +29,32 @@ create type AddressType as open {
 
 create type AllType as open {
   id: int64,
-  name: string,
-  age: float,
-  salary: double,
-  married: boolean,
-  interests: {{string}},
-  children: [string],
-  address: AddressType,
-  dob: date,
+  string: string,
+  float: float,
+  double: double,
+  boolean: boolean,
+  int8: int8,
+  int16: int16,
+  int32: int32,
+  int64: int64,
+  unorderedList: {{string}},
+  orderedList: [string],
+  record: AddressType,
+  date: date,
   time: time,
   datetime: datetime,
   duration: duration,
-  location2d: point,
-  location3d: point3d,
+  point: point,
+  point3d: point3d,
   line: line,
+  rectangle: rectangle,
   polygon: polygon,
   circle: circle,
-  binary: binary
+  binary: binary,
+  uuid: uuid
   // union
 }
 
 create external dataset All(AllType)
 using "org.apache.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/nontagged/allData.json"),("format"="adm"));
+(("path"="nc1://data/nontagged/allData.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
index 81db3ca..cc5daca 100644
--- a/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
+++ b/asterix-app/src/test/resources/runtimets/queries/scan/alltypes_02/alltypes_02.1.ddl.aql
@@ -36,26 +36,32 @@ create type AddressType as open {
 
 create type AllType as open {
   id: int64,
-  name: string,
-  age: float,
-  salary: double,
-  married: boolean,
-  interests: {{string}},
-  children: [string],
-  address: AddressType,
-  dob: date,
+  string: string,
+  float: float,
+  double: double,
+  boolean: boolean,
+  int8: int8,
+  int16: int16,
+  int32: int32,
+  int64: int64,
+  unorderedList: {{string}},
+  orderedList: [string],
+  record: AddressType,
+  date: date,
   time: time,
   datetime: datetime,
   duration: duration,
-  location2d: point,
-  location3d: point3d,
+  point: point,
+  point3d: point3d,
   line: line,
+  rectangle: rectangle,
   polygon: polygon,
   circle: circle,
-  binary: binary
+  binary: binary,
+  uuid: uuid
   // union
 }
 
 create external dataset All(AllType)
 using "org.apache.asterix.external.dataset.adapter.NCFileSystemAdapter"
-(("path"="nc1://data/nontagged/allData.json"),("format"="adm"));
+(("path"="nc1://data/nontagged/allData.adm"),("format"="adm"));

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/json/int01-cleanjson/int01.1.json
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/json/int01-cleanjson/int01.1.json b/asterix-app/src/test/resources/runtimets/results/json/int01-cleanjson/int01.1.json
index 205afcd..598e35e 100644
--- a/asterix-app/src/test/resources/runtimets/results/json/int01-cleanjson/int01.1.json
+++ b/asterix-app/src/test/resources/runtimets/results/json/int01-cleanjson/int01.1.json
@@ -1,8 +1,2 @@
-[ [ { "int64":
-1
-}
-, { "int64":
-2
-}
- ] 
+[ [ 1, 2 ] 
  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/json/int01-losslessjson/int01.1.json
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/json/int01-losslessjson/int01.1.json b/asterix-app/src/test/resources/runtimets/results/json/int01-losslessjson/int01.1.json
index 18c06b6..a0533de 100644
--- a/asterix-app/src/test/resources/runtimets/results/json/int01-losslessjson/int01.1.json
+++ b/asterix-app/src/test/resources/runtimets/results/json/int01-losslessjson/int01.1.json
@@ -1,8 +1,2 @@
-[ { "orderedlist": [ { "int64":
-1
-}
-, { "int64":
-2
-}
- ] }
+[ { "orderedlist": [ { "int64": 1 }, { "int64": 2 } ] }
  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-cleanjson/alltypes_01.1.json
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-cleanjson/alltypes_01.1.json b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-cleanjson/alltypes_01.1.json
new file mode 100644
index 0000000..5081d69
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-cleanjson/alltypes_01.1.json
@@ -0,0 +1,2 @@
+[ { "id": 10, "string": "Nancy", "float": 32.5, "double": -2013.5938237483274, "boolean": true, "int8": 125, "int16": 32765, "int32": 294967295, "int64": 1700000000000000000, "unorderedList": [ "reading", "writing" ], "orderedList": [ "Brad", "Scott" ], "record": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "date": { "date": -125625945600000}, "time": { "time": 44430000}, "datetime": { "datetime": -123703587570000}, "duration": { "duration": { "months": 131, "millis": 1075830000} }, "point": [41.0, 44.0], "point3d": [44.0, 13.0, 41.0], "line": [ [10.1, 11.1], [10.2, 11.2] ], "rectangle": [ [5.1, 11.8], [87.6, 15.6548] ], "polygon": [ [1.2, 1.3], [2.1, 2.5], [3.5, 3.6], [4.6, 4.8] ], "circle": [ [10.1, 11.1], 10.2 ], "binary": "ABCDEF0123456789", "uuid": "5c848e5c-6b6a-498f-8452-8847a2957421" }
+ ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-losslessjson/alltypes_01.1.json
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-losslessjson/alltypes_01.1.json b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-losslessjson/alltypes_01.1.json
new file mode 100644
index 0000000..5ee58be
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01-losslessjson/alltypes_01.1.json
@@ -0,0 +1,2 @@
+[ { "id": { "int64": 10 }, "string": "Nancy", "float": 32.5, "double": -2013.5938237483274, "boolean": true, "int8": { "int8": 125 }, "int16": { "int16": 32765 }, "int32": { "int32": 294967295 }, "int64": { "int64": 1700000000000000000 }, "unorderedList": { "unorderedlist": [ "reading", "writing" ] }, "orderedList": { "orderedlist": [ "Brad", "Scott" ] }, "record": { "number": { "int64": 8389 }, "street": "Hill St.", "city": "Mountain View" }, "date": { "date": -125625945600000}, "time": { "time": 44430000}, "datetime": { "datetime": -123703587570000}, "duration": { "duration": { "months": 131, "millis": 1075830000} }, "point": { "point": [41.0, 44.0] }, "point3d": { "point3d": [44.0, 13.0, 41.0] }, "line": { "line":  [ { "point": [10.1, 11.1] }, { "point": [10.2, 11.2] } ] }, "rectangle": { "rectangle": [{ "point": [5.1, 11.8] }, { "point": [87.6, 15.6548] } ] }, "polygon": { "polygon": [{ "point": [1.2, 1.3] },{ "point": [2.1, 2.5] },{ "point": [3.5, 3.6] },{ "point": [4.6, 4.8] }
 ] }, "circle": { "circle": [ { "point": [10.1, 11.1] }, 10.2 ] }, "binary": "ABCDEF0123456789", "uuid": "5c848e5c-6b6a-498f-8452-8847a2957421" }
+ ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01/alltypes_01.1.adm
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01/alltypes_01.1.adm b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01/alltypes_01.1.adm
index 6d9f6e9..66df0aa 100644
--- a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01/alltypes_01.1.adm
+++ b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_01/alltypes_01.1.adm
@@ -1,2 +1,2 @@
-[ { "id": 10, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "binary": hex("ABCDEF0123456789") }
+[ { "id": 10, "string": "Nancy", "float": 32.5f, "double": -2013.5938237483274d, "boolean": true, "int8": 125i8, "int16": 32765i16, "int32": 294967295i32, "int64": 1700000000000000000, "unorderedList": {{ "reading", "writing" }}, "orderedList": [ "Brad", "Scott" ], "record": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "date": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "point": point("41.0,44.0"), "point3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "rectangle": rectangle("5.1,11.8 87.6,15.6548"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "binary": hex("ABCDEF0123456789"), "uuid": uuid("5c848e5c-6b6a-498f-8452-8847a2957421") }
  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/results/scan/alltypes_02/alltypes_02.1.adm
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_02/alltypes_02.1.adm b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_02/alltypes_02.1.adm
index 6d9f6e9..66df0aa 100644
--- a/asterix-app/src/test/resources/runtimets/results/scan/alltypes_02/alltypes_02.1.adm
+++ b/asterix-app/src/test/resources/runtimets/results/scan/alltypes_02/alltypes_02.1.adm
@@ -1,2 +1,2 @@
-[ { "id": 10, "name": "Nancy", "age": 32.5f, "salary": 12.0d, "married": true, "interests": {{ "reading", "writing" }}, "children": [ "Brad", "Scott" ], "address": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "dob": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "location2d": point("41.0,44.0"), "location3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "binary": hex("ABCDEF0123456789") }
+[ { "id": 10, "string": "Nancy", "float": 32.5f, "double": -2013.5938237483274d, "boolean": true, "int8": 125i8, "int16": 32765i16, "int32": 294967295i32, "int64": 1700000000000000000, "unorderedList": {{ "reading", "writing" }}, "orderedList": [ "Brad", "Scott" ], "record": { "number": 8389, "street": "Hill St.", "city": "Mountain View" }, "date": date("-2011-01-27"), "time": time("12:20:30.000Z"), "datetime": datetime("-1951-12-27T12:20:30.000Z"), "duration": duration("P10Y11M12DT10H50M30S"), "point": point("41.0,44.0"), "point3d": point3d("44.0,13.0,41.0"), "line": line("10.1,11.1 10.2,11.2"), "rectangle": rectangle("5.1,11.8 87.6,15.6548"), "polygon": polygon("1.2,1.3 2.1,2.5 3.5,3.6 4.6,4.8"), "circle": circle("10.1,11.1 10.2"), "binary": hex("ABCDEF0123456789"), "uuid": uuid("5c848e5c-6b6a-498f-8452-8847a2957421") }
  ]

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-app/src/test/resources/runtimets/testsuite.xml
----------------------------------------------------------------------
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index 4dff76b..d378dca 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -4433,6 +4433,16 @@
             </compilation-unit>
         </test-case>
         <test-case FilePath="scan">
+            <compilation-unit name="alltypes_01">
+                <output-dir compare="Lossless-JSON">alltypes_01-losslessjson</output-dir>
+            </compilation-unit>
+        </test-case>
+        <test-case FilePath="scan">
+            <compilation-unit name="alltypes_01">
+                <output-dir compare="Clean-JSON">alltypes_01-cleanjson</output-dir>
+            </compilation-unit>
+        </test-case>
+        <test-case FilePath="scan">
             <compilation-unit name="alltypes_02">
                 <output-dir compare="Text">alltypes_02</output-dir>
             </compilation-unit>
@@ -5343,7 +5353,7 @@
             </compilation-unit>
         </test-case>
         <test-case FilePath="tpch">
-            <compilation-unit name="q17_small_quantity_order_revenue">
+            <compilation-unit name="q17_squantity_order_revenue">
                 <output-dir compare="Text">q17_small_quantity_order_revenue</output-dir>
             </compilation-unit>
         </test-case>

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
new file mode 100644
index 0000000..6f94c92
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/PrintTools.java
@@ -0,0 +1,169 @@
+/*
+ * 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.dataflow.data.nontagged.printers;
+
+import java.io.IOException;
+import java.io.OutputStream;
+
+import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
+
+public class PrintTools {
+
+    public enum CASE {
+        LOWER_CASE,
+        UPPER_CASE,
+    }
+
+
+    public static void writeUTF8StringAsCSV(byte[] b, int s, int l, OutputStream os) throws IOException {
+        int stringLength = UTF8StringPointable.getUTFLength(b, s);
+        int position = s + 2; // skip 2 bytes containing string size
+        int maxPosition = position + stringLength;
+        os.write('"');
+        while (position < maxPosition) {
+            char c = UTF8StringPointable.charAt(b, position);
+            int sz = UTF8StringPointable.charSize(b, position);
+            if (c == '"') {
+                os.write('"');
+            }
+            os.write(c);
+            position += sz;
+        }
+        os.write('"');
+    }
+
+    public static void writeUTF8StringAsJSON(byte[] b, int s, int l, OutputStream os) throws IOException {
+        int stringLength = UTF8StringPointable.getUTFLength(b, s);
+        int position = s + 2; // skip 2 bytes containing string size
+        int maxPosition = position + stringLength;
+        os.write('"');
+        while (position < maxPosition) {
+            char c = UTF8StringPointable.charAt(b, position);
+            int sz = UTF8StringPointable.charSize(b, position);
+            switch (c) {
+                // escape
+                case '\b':
+                    os.write('\\');
+                    os.write('b');
+                    position += sz;
+                    break;
+                case '\f':
+                    os.write('\\');
+                    os.write('f');
+                    position += sz;
+                    break;
+                case '\n':
+                    os.write('\\');
+                    os.write('n');
+                    position += sz;
+                    break;
+                case '\r':
+                    os.write('\\');
+                    os.write('r');
+                    position += sz;
+                    break;
+                case '\t':
+                    os.write('\\');
+                    os.write('t');
+                    position += sz;
+                    break;
+                case '\\':
+                case '"':
+                    os.write('\\');
+                default:
+                    switch (sz) {
+                        case 1:
+                            if (c <= (byte) 0x1f || c == (byte) 0x7f) {
+                                // this is to print out "control code points" (single byte UTF-8 representation,
+                                // value up to 0x1f or 0x7f) in the 'uXXXX' format
+                                writeUEscape(os, c);
+                                ++position;
+                                sz = 0; // no more processing
+                            }
+                            break;
+
+                        case 2:
+                            // 2-byte encodings of some code points in modified UTF-8 as described in
+                            // DataInput.html#modified-utf-8
+                            //
+                            //         110xxxxx  10xxxxxx
+                            // U+0000     00000    000000   C0 80
+                            // U+0080     00010    000000   C2 80
+                            // U+009F     00010    011111   C2 9F
+                            switch (b[position]) {
+                                case (byte) 0xc0:
+                                    if (b[position + 1] == (byte) 0x80) {
+                                        // special treatment for the U+0000 code point as described in
+                                        // DataInput.html#modified-utf-8
+                                        writeUEscape(os, c);
+                                        position += 2;
+                                        sz = 0; // no more processing
+                                    }
+                                    break;
+                                case (byte) 0xc2:
+                                    if (b[position + 1] <= (byte) 0x9f) {
+                                        // special treatment for the U+0080 to U+009F code points
+                                        writeUEscape(os, c);
+                                        position += 2;
+                                        sz = 0; // no more processing
+                                    }
+                                    break;
+                            }
+                            break;
+                    }
+                    while (sz > 0) {
+                        os.write(b[position]);
+                        ++position;
+                        --sz;
+                    }
+                    break;
+            }
+        }
+        os.write('\"');
+    }
+
+    private static void writeUEscape(OutputStream os, char c) throws IOException {
+        os.write('\\');
+        os.write('u');
+        os.write('0');
+        os.write('0');
+        os.write(hex((c >>> 4) & 0x0f, CASE.LOWER_CASE));
+        os.write(hex(c & 0x0f, CASE.LOWER_CASE));
+    }
+
+    public static Appendable printHexString(byte[] bytes, int start, int length, Appendable appendable)
+            throws IOException {
+        for (int i = 0; i < length; ++i) {
+            appendable.append((char) hex((bytes[start + i] >>> 4) & 0x0f, CASE.UPPER_CASE));
+            appendable.append((char) hex((bytes[start + i] & 0x0f), CASE.UPPER_CASE));
+        }
+        return appendable;
+    }
+
+    public static byte hex(int i, CASE c) {
+        switch (c) {
+            case LOWER_CASE:
+                return (byte) (i < 10 ? i + '0' : i + ('a' - 10));
+            case UPPER_CASE:
+                return (byte) (i < 10 ? i + '0' : i + ('A' - 10));
+        }
+        return Byte.parseByte(null);
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
index d21a17d..b9f9750 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/ABinaryHexPrinter.java
@@ -19,6 +19,7 @@
 
 package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.asterix.dataflow.data.nontagged.serde.ABinarySerializerDeserializer;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.data.IPrinter;
@@ -41,19 +42,10 @@ public class ABinaryHexPrinter implements IPrinter {
         int start = s + 1 + ABinarySerializerDeserializer.SIZE_OF_LENGTH;
         try {
             ps.print("hex(\"");
-            printHexString(b, start, validLength, ps);
+            PrintTools.printHexString(b, start, validLength, ps);
             ps.print("\")");
         } catch (IOException e) {
             throw new AlgebricksException(e);
         }
     }
-
-    public static Appendable printHexString(byte[] bytes, int start, int length, Appendable appendable)
-            throws IOException {
-        for (int i = 0; i < length; ++i) {
-            appendable.append((char) PrintTools.hex((bytes[start + i] >>> 4) & 0x0f, PrintTools.CASE.UPPER_CASE));
-            appendable.append((char) PrintTools.hex((bytes[start + i] & 0x0f), PrintTools.CASE.UPPER_CASE));
-        }
-        return appendable;
-    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AStringPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AStringPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AStringPrinter.java
index c767330..e53c95f 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AStringPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/AStringPrinter.java
@@ -21,6 +21,7 @@ package org.apache.asterix.dataflow.data.nontagged.printers.adm;
 import java.io.IOException;
 import java.io.PrintStream;
 
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.data.IPrinter;
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/PrintTools.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/PrintTools.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/PrintTools.java
deleted file mode 100644
index 395bfd8..0000000
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/adm/PrintTools.java
+++ /dev/null
@@ -1,159 +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.dataflow.data.nontagged.printers.adm;
-
-import java.io.IOException;
-import java.io.OutputStream;
-
-import org.apache.hyracks.data.std.primitive.UTF8StringPointable;
-
-public class PrintTools {
-    public static enum CASE {
-        LOWER_CASE,
-        UPPER_CASE,
-    }
-
-
-    public static void writeUTF8StringAsCSV(byte[] b, int s, int l, OutputStream os) throws IOException {
-        int stringLength = UTF8StringPointable.getUTFLength(b, s);
-        int position = s + 2; // skip 2 bytes containing string size
-        int maxPosition = position + stringLength;
-        os.write('"');
-        while (position < maxPosition) {
-            char c = UTF8StringPointable.charAt(b, position);
-            int sz = UTF8StringPointable.charSize(b, position);
-            if (c == '"') {
-                os.write('"');
-            }
-            os.write(c);
-            position += sz;
-        }
-        os.write('"');
-    }
-
-    public static void writeUTF8StringAsJSON(byte[] b, int s, int l, OutputStream os) throws IOException {
-        int stringLength = UTF8StringPointable.getUTFLength(b, s);
-        int position = s + 2; // skip 2 bytes containing string size
-        int maxPosition = position + stringLength;
-        os.write('"');
-        while (position < maxPosition) {
-            char c = UTF8StringPointable.charAt(b, position);
-            int sz = UTF8StringPointable.charSize(b, position);
-            switch (c) {
-                // escape
-                case '\b':
-                    os.write('\\');
-                    os.write('b');
-                    position += sz;
-                    break;
-                case '\f':
-                    os.write('\\');
-                    os.write('f');
-                    position += sz;
-                    break;
-                case '\n':
-                    os.write('\\');
-                    os.write('n');
-                    position += sz;
-                    break;
-                case '\r':
-                    os.write('\\');
-                    os.write('r');
-                    position += sz;
-                    break;
-                case '\t':
-                    os.write('\\');
-                    os.write('t');
-                    position += sz;
-                    break;
-                case '\\':
-                case '"':
-                    os.write('\\');
-                default:
-                    switch (sz) {
-                        case 1:
-                            if (c <= (byte) 0x1f || c == (byte) 0x7f) {
-                                // this is to print out "control code points" (single byte UTF-8 representation,
-                                // value up to 0x1f or 0x7f) in the 'uXXXX' format
-                                writeUEscape(os, c);
-                                ++position;
-                                sz = 0; // no more processing
-                            }
-                            break;
-
-                        case 2:
-                            // 2-byte encodings of some code points in modified UTF-8 as described in
-                            // DataInput.html#modified-utf-8
-                            //
-                            //         110xxxxx  10xxxxxx
-                            // U+0000     00000    000000   C0 80
-                            // U+0080     00010    000000   C2 80
-                            // U+009F     00010    011111   C2 9F
-                            switch (b[position]) {
-                                case (byte) 0xc0:
-                                    if (b[position + 1] == (byte) 0x80) {
-                                        // special treatment for the U+0000 code point as described in
-                                        // DataInput.html#modified-utf-8
-                                        writeUEscape(os, c);
-                                        position += 2;
-                                        sz = 0; // no more processing
-                                    }
-                                    break;
-                                case (byte) 0xc2:
-                                    if (b[position + 1] <= (byte) 0x9f) {
-                                        // special treatment for the U+0080 to U+009F code points
-                                        writeUEscape(os, c);
-                                        position += 2;
-                                        sz = 0; // no more processing
-                                    }
-                                    break;
-                            }
-                            break;
-                    }
-                    while (sz > 0) {
-                        os.write(b[position]);
-                        ++position;
-                        --sz;
-                    }
-                    break;
-            }
-        }
-        os.write('\"');
-    }
-
-    private static void writeUEscape(OutputStream os, char c) throws IOException {
-        os.write('\\');
-        os.write('u');
-        os.write('0');
-        os.write('0');
-        os.write(hex((c >>> 4) & 0x0f, CASE.LOWER_CASE));
-        os.write(hex(c & 0x0f, CASE.LOWER_CASE));
-    }
-
-    static byte hex(int i, CASE c) {
-        switch (c) {
-            case LOWER_CASE:
-                return (byte) (i < 10 ? i + '0' : i + ('a' - 10));
-            case UPPER_CASE:
-                return (byte) (i < 10 ? i + '0' : i + ('A' - 10));
-        }
-        return Byte.parseByte(null);
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/csv/AStringPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/csv/AStringPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/csv/AStringPrinter.java
index c88efe4..8c6337e 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/csv/AStringPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/csv/AStringPrinter.java
@@ -21,7 +21,7 @@ package org.apache.asterix.dataflow.data.nontagged.printers.csv;
 import java.io.IOException;
 import java.io.PrintStream;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.PrintTools;
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.data.IPrinter;
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryHexPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryHexPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryHexPrinter.java
new file mode 100644
index 0000000..97f5203
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryHexPrinter.java
@@ -0,0 +1,52 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.clean;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
+import org.apache.asterix.dataflow.data.nontagged.serde.ABinarySerializerDeserializer;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.data.IPrinter;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+public class ABinaryHexPrinter implements IPrinter {
+    private ABinaryHexPrinter() {
+    }
+
+    public static final ABinaryHexPrinter INSTANCE = new ABinaryHexPrinter();
+
+    @Override public void init() throws AlgebricksException {
+
+    }
+
+    @Override public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        int validLength = ABinarySerializerDeserializer.getLength(b, s + 1);
+        int start = s + 1 + ABinarySerializerDeserializer.SIZE_OF_LENGTH;
+        try {
+            ps.print("\"");
+            PrintTools.printHexString(b, start, validLength, ps);
+            ps.print("\"");
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryPrinterFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryPrinterFactory.java
new file mode 100644
index 0000000..68b8858
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ABinaryPrinterFactory.java
@@ -0,0 +1,35 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.clean;
+
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.algebricks.data.IPrinterFactory;
+
+public class ABinaryPrinterFactory implements IPrinterFactory {
+
+    private ABinaryPrinterFactory() {
+    }
+
+    public static final ABinaryPrinterFactory INSTANCE = new ABinaryPrinterFactory();
+
+    @Override public IPrinter createPrinter() {
+        return ABinaryHexPrinter.INSTANCE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ACirclePrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ACirclePrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ACirclePrinter.java
index fe85f04..b81878a 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ACirclePrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ACirclePrinter.java
@@ -35,12 +35,12 @@ public class ACirclePrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"circle\": [");
+        ps.print("[ [");
         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 + 9));
+        ps.print("], ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
-        ps.print("] } ] }");
+        ps.print(" ]");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt16Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt16Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt16Printer.java
index e4d910f..992f422 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt16Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt16Printer.java
@@ -35,9 +35,6 @@ public class AInt16Printer implements IPrinter {
     @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("}");
+        ps.print(i);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt32Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt32Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt32Printer.java
index 597988a..03a5615 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt32Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt32Printer.java
@@ -36,9 +36,6 @@ public class AInt32Printer implements IPrinter {
     @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("}");
+        ps.print(d);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt64Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt64Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt64Printer.java
index dac725a..edff119 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt64Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt64Printer.java
@@ -34,8 +34,6 @@ public class AInt64Printer implements IPrinter {
     @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("}");
+        ps.print(d);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt8Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt8Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt8Printer.java
index 86ade85..7bdc127 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt8Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AInt8Printer.java
@@ -36,9 +36,6 @@ public class AInt8Printer implements IPrinter {
     @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("}");
+        ps.print(o);
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ALinePrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ALinePrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ALinePrinter.java
index 88b98c7..9927b20 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ALinePrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ALinePrinter.java
@@ -35,15 +35,14 @@ public class ALinePrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"line\": ");
-        ps.print(" [ { \"point\": [");
+        ps.print("[ [");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
         ps.print(", ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
-        ps.print("] }, { \"point\": [");
+        ps.print("], [");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
         ps.print(", ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
-        ps.print("] } ] }");
+        ps.print("] ]");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AObjectPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AObjectPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AObjectPrinter.java
index 0acd4f3..8f06d77 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AObjectPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AObjectPrinter.java
@@ -20,7 +20,6 @@ package org.apache.asterix.dataflow.data.nontagged.printers.json.clean;
 
 import java.io.PrintStream;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.ABinaryHexPrinter;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -151,6 +150,10 @@ public class AObjectPrinter implements IPrinter {
                 unorderedListPrinter.print(b, s, l, ps);
                 break;
             }
+            case UUID: {
+                AUUIDPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
             case ANY:
             case BITARRAY:
             case ENUM:
@@ -163,7 +166,6 @@ public class AObjectPrinter implements IPrinter {
             case UINT64:
             case UINT8:
             case UNION:
-            case UUID:
             case UUID_STRING:
                 throw new NotImplementedException("No printer for type " + typeTag);
         }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APoint3DPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APoint3DPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APoint3DPrinter.java
index 6854c69..169c799 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APoint3DPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APoint3DPrinter.java
@@ -35,12 +35,12 @@ public class APoint3DPrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"point3d\": [");
+        ps.print("[");
         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("] }");
+        ps.print("]");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APointPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APointPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APointPrinter.java
index b3b922b..7cd4eef 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APointPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APointPrinter.java
@@ -35,10 +35,10 @@ public class APointPrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"point\": [");
+        ps.print("[");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
         ps.print(", ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
-        ps.print("] }");
+        ps.print("]");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APolygonPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APolygonPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APolygonPrinter.java
index ff30909..c4fa103 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APolygonPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/APolygonPrinter.java
@@ -39,22 +39,22 @@ public class APolygonPrinter implements IPrinter {
         short numberOfPoints = AInt16SerializerDeserializer.getShort(b, s + 1);
         s += 3;
 
-        ps.print("{ \"polygon\": [");
+        ps.print("[ ");
 
         for (int i = 0; i < numberOfPoints; i++) {
             if (i > 0)
-                ps.print(",");
+                ps.print(", ");
 
-            ps.print("{ \"point\": [");
+            ps.print("[");
             ps.print(ADoubleSerializerDeserializer.getDouble(b, s));
             ps.print(", ");
             ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 8));
-            ps.print("] }");
+            ps.print("]");
 
             s += 16;
         }
 
-        ps.print("] }");
+        ps.print(" ]");
 
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ARectanglePrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ARectanglePrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ARectanglePrinter.java
index 36a888f..253d2e4 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ARectanglePrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/ARectanglePrinter.java
@@ -35,15 +35,14 @@ public class ARectanglePrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"rectangle\": [");
-        ps.print("{ \"point\": [");
+        ps.print("[ [");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 1));
         ps.print(", ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 9));
-        ps.print("] }, { \"point\": [");
+        ps.print("], [");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
         ps.print(", ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 25));
-        ps.print("] } ] }");
+        ps.print("] ]");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AStringPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AStringPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AStringPrinter.java
index 6abe4df..04fb8a0 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AStringPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AStringPrinter.java
@@ -21,7 +21,7 @@ package org.apache.asterix.dataflow.data.nontagged.printers.json.clean;
 import java.io.IOException;
 import java.io.PrintStream;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.PrintTools;
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.data.IPrinter;
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinter.java
new file mode 100644
index 0000000..4057bbe
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinter.java
@@ -0,0 +1,48 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.clean;
+
+import org.apache.asterix.om.base.AMutableUUID;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.data.std.primitive.LongPointable;
+
+import java.io.PrintStream;
+
+public class AUUIDPrinter implements IPrinter {
+
+    public static final AUUIDPrinter INSTANCE = new AUUIDPrinter();
+    // We use mutable UUID not to create a UUID object multiple times.
+    AMutableUUID uuid = new AMutableUUID(0, 0);
+
+    @Override
+    public void init() throws AlgebricksException {
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        long msb = LongPointable.getLong(b, s + 1);
+        long lsb = LongPointable.getLong(b, s + 9);
+        uuid.setValue(msb, lsb);
+
+        ps.print("\"" + uuid.toStringLiteralOnly() + "\"");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinterFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinterFactory.java
new file mode 100644
index 0000000..f84b5b8
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/clean/AUUIDPrinterFactory.java
@@ -0,0 +1,37 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.clean;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.adm.AUUIDPrinter;
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.algebricks.data.IPrinterFactory;
+
+public class AUUIDPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final AUUIDPrinterFactory INSTANCE = new AUUIDPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AUUIDPrinter.INSTANCE;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryHexPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryHexPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryHexPrinter.java
new file mode 100644
index 0000000..af84be7
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryHexPrinter.java
@@ -0,0 +1,51 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.lossless;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
+import org.apache.asterix.dataflow.data.nontagged.serde.ABinarySerializerDeserializer;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.data.IPrinter;
+
+import java.io.IOException;
+import java.io.PrintStream;
+
+public class ABinaryHexPrinter implements IPrinter {
+    private ABinaryHexPrinter() {
+    }
+
+    public static final ABinaryHexPrinter INSTANCE = new ABinaryHexPrinter();
+
+    @Override public void init() throws AlgebricksException {
+
+    }
+
+    @Override public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        int validLength = ABinarySerializerDeserializer.getLength(b, s + 1);
+        int start = s + 1 + ABinarySerializerDeserializer.SIZE_OF_LENGTH;
+        try {
+            ps.print("\"");
+            PrintTools.printHexString(b, start, validLength, ps);
+            ps.print("\"");
+        } catch (IOException e) {
+            throw new AlgebricksException(e);
+        }
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryPrinterFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryPrinterFactory.java
new file mode 100644
index 0000000..06b423f
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ABinaryPrinterFactory.java
@@ -0,0 +1,35 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.lossless;
+
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.algebricks.data.IPrinterFactory;
+
+public class ABinaryPrinterFactory implements IPrinterFactory {
+
+    private ABinaryPrinterFactory() {
+    }
+
+    public static final ABinaryPrinterFactory INSTANCE = new ABinaryPrinterFactory();
+
+    @Override public IPrinter createPrinter() {
+        return ABinaryHexPrinter.INSTANCE;
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ACirclePrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ACirclePrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ACirclePrinter.java
index fa41267..c7f179b 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ACirclePrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/ACirclePrinter.java
@@ -35,12 +35,12 @@ public class ACirclePrinter implements IPrinter {
 
     @Override
     public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
-        ps.print("{ \"circle\": [");
+        ps.print("{ \"circle\": [ { \"point\": [");
         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 + 9));
+        ps.print("] }, ");
         ps.print(ADoubleSerializerDeserializer.getDouble(b, s + 17));
-        ps.print("] } ] }");
+        ps.print(" ] }");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt16Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt16Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt16Printer.java
index 22506e1..7b09ec8 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt16Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt16Printer.java
@@ -36,8 +36,8 @@ public class AInt16Printer implements IPrinter {
     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("}");
+        ps.print("{ \"int16\": ");
+        ps.print(i);
+        ps.print(" }");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt32Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt32Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt32Printer.java
index 3ebaec9..a757a35 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt32Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt32Printer.java
@@ -37,8 +37,8 @@ public class AInt32Printer implements IPrinter {
     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("}");
+        ps.print("{ \"int32\": ");
+        ps.print(d);
+        ps.print(" }");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt64Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt64Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt64Printer.java
index 9620116..f01a5d5 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt64Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt64Printer.java
@@ -34,8 +34,8 @@ public class AInt64Printer implements IPrinter {
     @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("}");
+        ps.print("{ \"int64\": ");
+        ps.print(d);
+        ps.print(" }");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt8Printer.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt8Printer.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt8Printer.java
index c343717..a1afc3f 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt8Printer.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AInt8Printer.java
@@ -37,8 +37,8 @@ public class AInt8Printer implements IPrinter {
     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("}");
+        ps.print("{ \"int8\": ");
+        ps.print(o);
+        ps.print(" }");
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AObjectPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AObjectPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AObjectPrinter.java
index e82ea65..1f610d0 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AObjectPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AObjectPrinter.java
@@ -20,7 +20,6 @@ package org.apache.asterix.dataflow.data.nontagged.printers.json.lossless;
 
 import java.io.PrintStream;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.ABinaryHexPrinter;
 import org.apache.asterix.om.types.ATypeTag;
 import org.apache.asterix.om.types.EnumDeserializer;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
@@ -151,6 +150,10 @@ public class AObjectPrinter implements IPrinter {
                 unorderedListPrinter.print(b, s, l, ps);
                 break;
             }
+            case UUID: {
+                AUUIDPrinter.INSTANCE.print(b, s, l, ps);
+                break;
+            }
             case ANY:
             case BITARRAY:
             case ENUM:
@@ -163,7 +166,6 @@ public class AObjectPrinter implements IPrinter {
             case UINT64:
             case UINT8:
             case UNION:
-            case UUID:
             case UUID_STRING:
                 throw new NotImplementedException("No printer for type " + typeTag);
         }

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AStringPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AStringPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AStringPrinter.java
index 55c285d..fdc85be 100644
--- a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AStringPrinter.java
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AStringPrinter.java
@@ -21,7 +21,7 @@ package org.apache.asterix.dataflow.data.nontagged.printers.json.lossless;
 import java.io.IOException;
 import java.io.PrintStream;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.PrintTools;
+import org.apache.asterix.dataflow.data.nontagged.printers.PrintTools;
 import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
 import org.apache.hyracks.algebricks.data.IPrinter;
 

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinter.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinter.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinter.java
new file mode 100644
index 0000000..0c955b5
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinter.java
@@ -0,0 +1,48 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.lossless;
+
+import org.apache.asterix.om.base.AMutableUUID;
+import org.apache.hyracks.algebricks.common.exceptions.AlgebricksException;
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.data.std.primitive.LongPointable;
+
+import java.io.PrintStream;
+
+public class AUUIDPrinter implements IPrinter {
+
+    public static final AUUIDPrinter INSTANCE = new AUUIDPrinter();
+    // We use mutable UUID not to create a UUID object multiple times.
+    AMutableUUID uuid = new AMutableUUID(0, 0);
+
+    @Override
+    public void init() throws AlgebricksException {
+    }
+
+    @Override
+    public void print(byte[] b, int s, int l, PrintStream ps) throws AlgebricksException {
+        long msb = LongPointable.getLong(b, s + 1);
+        long lsb = LongPointable.getLong(b, s + 9);
+        uuid.setValue(msb, lsb);
+
+        ps.print("\"" + uuid.toStringLiteralOnly() + "\"");
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinterFactory.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinterFactory.java b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinterFactory.java
new file mode 100644
index 0000000..707d78c
--- /dev/null
+++ b/asterix-om/src/main/java/org/apache/asterix/dataflow/data/nontagged/printers/json/lossless/AUUIDPrinterFactory.java
@@ -0,0 +1,37 @@
+/*
+ * 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.dataflow.data.nontagged.printers.json.lossless;
+
+import org.apache.asterix.dataflow.data.nontagged.printers.adm.AUUIDPrinter;
+import org.apache.hyracks.algebricks.data.IPrinter;
+import org.apache.hyracks.algebricks.data.IPrinterFactory;
+
+public class AUUIDPrinterFactory implements IPrinterFactory {
+
+    private static final long serialVersionUID = 1L;
+
+    public static final AUUIDPrinterFactory INSTANCE = new AUUIDPrinterFactory();
+
+    @Override
+    public IPrinter createPrinter() {
+        return AUUIDPrinter.INSTANCE;
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
index 0f58aee..302ecd8 100644
--- a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
+++ b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlCleanJSONPrinterFactoryProvider.java
@@ -18,9 +18,9 @@
  */
 package org.apache.asterix.formats.nontagged;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.ABinaryPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.adm.AUUIDPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.adm.ShortWithoutTypeInfoPrinterFactory;
+import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ABinaryPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ABooleanPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ACirclePrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ADatePrinterFactory;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
index 012265a..5f8867a 100644
--- a/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
+++ b/asterix-om/src/main/java/org/apache/asterix/formats/nontagged/AqlLosslessJSONPrinterFactoryProvider.java
@@ -18,9 +18,9 @@
  */
 package org.apache.asterix.formats.nontagged;
 
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.ABinaryPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.adm.AUUIDPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.adm.ShortWithoutTypeInfoPrinterFactory;
+import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.ABinaryPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.ABooleanPrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.ACirclePrinterFactory;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.ADatePrinterFactory;

http://git-wip-us.apache.org/repos/asf/incubator-asterixdb/blob/7230d632/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
----------------------------------------------------------------------
diff --git a/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java b/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
index 716069e..bf9c9b6 100644
--- a/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
+++ b/asterix-om/src/main/java/org/apache/asterix/om/pointables/printer/json/clean/APrintVisitor.java
@@ -19,13 +19,7 @@
 
 package org.apache.asterix.om.pointables.printer.json.clean;
 
-import java.io.PrintStream;
-import java.util.HashMap;
-import java.util.Map;
-
 import org.apache.asterix.common.exceptions.AsterixException;
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.ABinaryHexPrinter;
-import org.apache.asterix.dataflow.data.nontagged.printers.adm.AUUIDPrinter;
 import org.apache.asterix.dataflow.data.nontagged.printers.adm.ShortWithoutTypeInfoPrinter;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ABooleanPrinter;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ACirclePrinter;
@@ -48,6 +42,8 @@ import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ARectangle
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.AStringPrinter;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.ATimePrinter;
 import org.apache.asterix.dataflow.data.nontagged.printers.json.clean.AYearMonthDurationPrinter;
+import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.ABinaryHexPrinter;
+import org.apache.asterix.dataflow.data.nontagged.printers.json.lossless.AUUIDPrinter;
 import org.apache.asterix.om.pointables.AFlatValuePointable;
 import org.apache.asterix.om.pointables.AListVisitablePointable;
 import org.apache.asterix.om.pointables.ARecordVisitablePointable;
@@ -57,6 +53,10 @@ import org.apache.asterix.om.types.ATypeTag;
 import org.apache.hyracks.algebricks.common.exceptions.NotImplementedException;
 import org.apache.hyracks.algebricks.common.utils.Pair;
 
+import java.io.PrintStream;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * 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


Mime
View raw message