[email protected] has uploaded a new change for review.

  https://asterix-gerrit.ics.uci.edu/3080

Change subject: print metrics for consistency, test for syntax error path
......................................................................

print metrics for consistency, test for syntax error path

Change-Id: I6dd16ab44507a99f760c04d69d73c0916b7ae26f
---
M 
asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
A 
asterixdb/asterix-app/src/test/resources/runtimets/queries/parseonly/002/named_02.1.parse.sqlpp
M asterixdb/asterix-app/src/test/resources/runtimets/testsuite_parseonly.xml
3 files changed, 38 insertions(+), 6 deletions(-)


  git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb 
refs/changes/80/3080/1

diff --git 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
index c771ca0..c775cb8 100644
--- 
a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
+++ 
b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/QueryServiceServlet.java
@@ -603,10 +603,10 @@
             sessionOutput.release();
             execution.finish();
         }
-        if (!param.isParseOnly()) {
-            printMetrics(sessionOutput.out(), System.nanoTime() - 
elapsedStart, execution.duration(), stats.getCount(),
+
+        printMetrics(sessionOutput.out(), System.nanoTime() - elapsedStart, 
execution.duration(), stats.getCount(),
                     stats.getSize(), stats.getProcessedObjects(), errorCount, 
warnings.size());
-        }
+
         sessionOutput.out().print("}\n");
         sessionOutput.out().flush();
         if (sessionOutput.out().checkError()) {
@@ -707,9 +707,7 @@
 
         pw.print(ResultUtil.ParseValuesJsonPrintUtils.asJson(parseOnlyResult));
 
-        //pw.print(",\n"); //TODO: comma or no comma
-        pw.print("\n"); //TODO: comma or no comma
-
+        pw.print(",\n");
     }
 
     protected void printExecutionPlans(SessionOutput output, ExecutionPlans 
executionPlans) {
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/queries/parseonly/002/named_02.1.parse.sqlpp
 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/parseonly/002/named_02.1.parse.sqlpp
new file mode 100644
index 0000000..13b9de5
--- /dev/null
+++ 
b/asterixdb/asterix-app/src/test/resources/runtimets/queries/parseonly/002/named_02.1.parse.sqlpp
@@ -0,0 +1,28 @@
+/*
+ * 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  : Test named statement parameters with json encoded request
+ * Expected Res : Failure
+ * Date         : Jun 2018
+ */
+
+-- param parse-only:string=true
+
+select count(*) from ChirpUsers name=$qname"
diff --git 
a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_parseonly.xml 
b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_parseonly.xml
index d443a9f..f7cea01 100644
--- a/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_parseonly.xml
+++ b/asterixdb/asterix-app/src/test/resources/runtimets/testsuite_parseonly.xml
@@ -25,5 +25,11 @@
                 <output-dir compare="Text">001</output-dir>
             </compilation-unit>
         </test-case>
+        <test-case FilePath="parseonly">
+            <compilation-unit name="002">
+                <output-dir compare="Text">named_02</output-dir>
+                <expected-error>ASX1001</expected-error>
+            </compilation-unit>
+        </test-case>
     </test-group>
 </test-suite>

-- 
To view, visit https://asterix-gerrit.ics.uci.edu/3080
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6dd16ab44507a99f760c04d69d73c0916b7ae26f
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: [email protected]

Reply via email to