This is an automated email from the ASF dual-hosted git repository.

xiangfu pushed a commit to branch switch-ui-to-sql
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git

commit 36303e5056fd340772e03940d2dc190a2515f193
Author: Xiang Fu <fx19880...@gmail.com>
AuthorDate: Fri Jan 17 04:17:12 2020 -0800

    Make sql as default query format.
---
 pinot-controller/src/main/resources/static/js/init.js      | 14 ++++++++++----
 .../src/main/resources/static/query/index.html             |  8 ++++----
 pinot-controller/src/main/resources/webapp/index.html      |  8 ++++----
 pinot-controller/src/main/resources/webapp/js/init.js      |  8 ++++----
 4 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/pinot-controller/src/main/resources/static/js/init.js 
b/pinot-controller/src/main/resources/static/js/init.js
index daddfe3..374535b 100644
--- a/pinot-controller/src/main/resources/static/js/init.js
+++ b/pinot-controller/src/main/resources/static/js/init.js
@@ -67,13 +67,13 @@ $(document).ready(function() {
     // execute query and draw the results
     var query = EDITOR.getValue().trim();
     var traceEnabled = document.getElementById('trace-enabled').checked;
-    var groupByModeSQL = document.getElementById('group-by-mode-sql').checked;
-    var responseFormatSQL = 
document.getElementById('response-format-sql').checked;
+    var groupByModePQL = document.getElementById('group-by-mode-pql').checked;
+    var responseFormatPQL = 
document.getElementById('response-format-pql').checked;
     var queryOptions = undefined;
-    if (groupByModeSQL === true) {
+    if (groupByModePQL !== true) {
       queryOptions = "groupByMode=sql";
     }
-    if (responseFormatSQL === true) {
+    if (responseFormatPQL !== true) {
       if (queryOptions === undefined) {
         queryOptions = "responseFormat=sql";
       } else {
@@ -130,6 +130,12 @@ $(document).ready(function() {
             row.push(aggregationGroup.value);
             return row;
           });
+        } else if (queryResponse["resultTable"] && 
queryResponse.resultTable["rows"]
+            && queryResponse.resultTable.rows.length > 0) {
+          columnList = _.map(queryResponse.resultTable.dataSchema.columnNames, 
function (columnName) {
+            return {"title": columnName};
+          });
+          dataArray = queryResponse.resultTable.rows;
         }
       }
 
diff --git a/pinot-controller/src/main/resources/static/query/index.html 
b/pinot-controller/src/main/resources/static/query/index.html
index 0e43c56..00ce760 100644
--- a/pinot-controller/src/main/resources/static/query/index.html
+++ b/pinot-controller/src/main/resources/static/query/index.html
@@ -79,11 +79,11 @@
           <div class="small-2 columns" title="Enables tracing">
             <input type=checkbox id="trace-enabled">&nbsp;&nbsp;Tracing</input>
           </div>
-          <div class="small-3 columns" title="Sets groupByMode=sql in 
queryOptions (default pql)">
-            <input type=checkbox id="group-by-mode-sql">&nbsp;&nbsp;Group By 
Mode : SQL</input>
+          <div class="small-3 columns" title="Sets groupByMode=pql in 
queryOptions (default sql)">
+            <input type=checkbox id="group-by-mode-pql">&nbsp;&nbsp;Group By 
Mode : PQL</input>
           </div>
-          <div class="small-4 columns" title="Sets responseFormat=sql in 
queryOptions (default pql)">
-            <input type=checkbox id="response-format-sql">&nbsp;&nbsp;Query 
Response Format : SQL</input>
+          <div class="small-4 columns" title="Sets responseFormat=pql in 
queryOptions (default sql)">
+            <input type=checkbox id="response-format-pql">&nbsp;&nbsp;Query 
Response Format : PQL</input>
           </div>
           <div class="small-2 columns"><a href="#" id="execute-query" 
class="button round success small">Run Query</a>
           </div>
diff --git a/pinot-controller/src/main/resources/webapp/index.html 
b/pinot-controller/src/main/resources/webapp/index.html
index 3662d0f..e5025b9 100644
--- a/pinot-controller/src/main/resources/webapp/index.html
+++ b/pinot-controller/src/main/resources/webapp/index.html
@@ -75,11 +75,11 @@
           <div class="small-2 columns" title="Enables tracing">
             <input type=checkbox id="trace-enabled">&nbsp;&nbsp;Tracing</input>
           </div>
-          <div class="small-3 columns" title="Sets groupByMode=sql in 
queryOptions (default pql)">
-            <input type=checkbox id="group-by-mode-sql">&nbsp;&nbsp;Group By 
Mode : SQL</input>
+          <div class="small-3 columns" title="Sets groupByMode=pql in 
queryOptions (default sql)">
+            <input type=checkbox id="group-by-mode-pql">&nbsp;&nbsp;Group By 
Mode : PQL</input>
           </div>
-          <div class="small-4 columns" title="Sets responseFormat=sql in 
queryOptions (default pql)">
-            <input type=checkbox id="response-format-sql">&nbsp;&nbsp;Query 
Response Format : SQL</input>
+          <div class="small-4 columns" title="Sets responseFormat=pql in 
queryOptions (default sql)">
+            <input type=checkbox id="response-format-pql">&nbsp;&nbsp;Query 
Response Format : PQL</input>
           </div>
           <div class="small-2 columns"><a href="#" id="execute-query" 
class="button round success small">Run Query</a>
           </div>
diff --git a/pinot-controller/src/main/resources/webapp/js/init.js 
b/pinot-controller/src/main/resources/webapp/js/init.js
index 6775aaa..d397b4a 100644
--- a/pinot-controller/src/main/resources/webapp/js/init.js
+++ b/pinot-controller/src/main/resources/webapp/js/init.js
@@ -65,13 +65,13 @@ $(document).ready(function() {
     // execute query and draw the results
     var query = EDITOR.getValue().trim();
     var traceEnabled = document.getElementById('trace-enabled').checked;
-    var groupByModeSQL = document.getElementById('group-by-mode-sql').checked;
-    var responseFormatSQL = 
document.getElementById('response-format-sql').checked;
+    var groupByModePQL = document.getElementById('group-by-mode-pql').checked;
+    var responseFormatPQL = 
document.getElementById('response-format-pql').checked;
     var queryOptions = undefined;
-    if (groupByModeSQL === true) {
+    if (groupByModePQL !== true) {
       queryOptions = "groupByMode=sql";
     }
-    if (responseFormatSQL === true) {
+    if (responseFormatPQL !== true) {
       if (queryOptions === undefined) {
         queryOptions = "responseFormat=sql";
       } else {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to