asterixdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ti...@apache.org
Subject asterixdb git commit: ASTERIXDB-1884: pretty printing of explain results
Date Wed, 19 Apr 2017 23:19:25 GMT
Repository: asterixdb
Updated Branches:
  refs/heads/master 39dd9059e -> d0baeedbd


ASTERIXDB-1884: pretty printing of explain results

Change-Id: I20a697610e2ac78b25b5a61d6d7348534330af37
Reviewed-on: https://asterix-gerrit.ics.uci.edu/1687
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
BAD: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Yingyi Bu <buyingyi@gmail.com>


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

Branch: refs/heads/master
Commit: d0baeedbd0b529cdb81d271d26c95919031dc5f1
Parents: 39dd905
Author: Till Westmann <tillw@apache.org>
Authored: Fri Apr 14 19:00:56 2017 -0700
Committer: Till Westmann <tillw@apache.org>
Committed: Wed Apr 19 16:18:49 2017 -0700

----------------------------------------------------------------------
 .../asterix/app/result/ResultPrinter.java       |  4 ++--
 .../explain_pretty/explain_pretty.1.query.sqlpp | 24 ++++++++++++++++++++
 .../resources/runtimets/testsuite_sqlpp.xml     |  6 +++++
 3 files changed, 32 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0baeedb/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/ResultPrinter.java
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/ResultPrinter.java
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/ResultPrinter.java
index c77ad44..590b854 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/ResultPrinter.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/app/result/ResultPrinter.java
@@ -164,8 +164,8 @@ public class ResultPrinter {
             // TODO(tillw): this is inefficient - do this during record generation
             try {
                 record = ow.writeValueAsString(om.readValue(result, Object.class));
-            } catch (IOException e) {
-                throw new HyracksDataException(e);
+            } catch (IOException e) { // NOSONAR if JSON parsing fails, just use the original
string
+                record = result;
             }
         }
         if (conf.fmt() == SessionConfig.OutputFormat.CSV) {

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0baeedb/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_pretty/explain_pretty.1.query.sqlpp
----------------------------------------------------------------------
diff --git a/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_pretty/explain_pretty.1.query.sqlpp
b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_pretty/explain_pretty.1.query.sqlpp
new file mode 100644
index 0000000..6860087
--- /dev/null
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/queries_sqlpp/explain/explain_pretty/explain_pretty.1.query.sqlpp
@@ -0,0 +1,24 @@
+/*
+ * 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.
+ */
+/*
+* Description  : EXPLAIN a plan for a very simple query
+* Expected Res : Success
+* Date         : Jul 25, 2016
+*/
+explain select value 1+1;

http://git-wip-us.apache.org/repos/asf/asterixdb/blob/d0baeedb/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 6f8b094..c2b0951 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_sqlpp.xml
@@ -131,6 +131,12 @@
         <output-dir compare="Text">explain_simple</output-dir>
       </compilation-unit>
     </test-case>
+    <test-case FilePath="explain">
+      <compilation-unit name="explain_pretty">
+        <parameter name="pretty" value="true" />
+        <output-dir compare="Text">explain_simple</output-dir>
+      </compilation-unit>
+    </test-case>
   </test-group>
   <test-case FilePath="flwor">
     <compilation-unit name="let33">


Mime
View raw message