ASTERIXDB-1165: Use clean JSON consistently

When printing nullable fields and unions, the clean JSON PrinterFactories
were using lossless JSON printers. This is now fixed.

Change-Id: I50442edc3187d003987bc4119559eda676c9b2eb
Reviewed-on: https://asterix-gerrit.ics.uci.edu/493
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterix-app/src/test/resources/runtimets/queries/json/issue-ASTERIXDB-1165/nullablefield.1.query.aql b/asterix-app/src/test/resources/runtimets/queries/json/issue-ASTERIXDB-1165/nullablefield.1.query.aql
new file mode 100644
index 0000000..958c58b
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/queries/json/issue-ASTERIXDB-1165/nullablefield.1.query.aql
@@ -0,0 +1,2 @@
+count(for $u in [1,2,3] return $u)
+
diff --git a/asterix-app/src/test/resources/runtimets/results/json/issue-ASTERIXDB-1165/nullablefield.1.json b/asterix-app/src/test/resources/runtimets/results/json/issue-ASTERIXDB-1165/nullablefield.1.json
new file mode 100644
index 0000000..f2868b6
--- /dev/null
+++ b/asterix-app/src/test/resources/runtimets/results/json/issue-ASTERIXDB-1165/nullablefield.1.json
@@ -0,0 +1,2 @@
+[ 3
+ ]
diff --git a/asterix-app/src/test/resources/runtimets/testsuite.xml b/asterix-app/src/test/resources/runtimets/testsuite.xml
index b2ded7b..430fd8e 100644
--- a/asterix-app/src/test/resources/runtimets/testsuite.xml
+++ b/asterix-app/src/test/resources/runtimets/testsuite.xml
@@ -6744,6 +6744,11 @@
                 <output-dir compare="Clean-JSON">int01-cleanjson</output-dir>
             </compilation-unit>
         </test-case>
+        <test-case FilePath="json">
+            <compilation-unit name="issue-ASTERIXDB-1165">
+                <output-dir compare="Clean-JSON">issue-ASTERIXDB-1165</output-dir>
+            </compilation-unit>
+        </test-case>
     </test-group>
     <test-group name="csv">
         <test-case FilePath="csv">