You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xi...@apache.org on 2020/01/17 12:17:32 UTC

[incubator-pinot] branch switch-ui-to-sql created (now 36303e5)

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

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


      at 36303e5  Make sql as default query format.

This branch includes the following new commits:

     new 36303e5  Make sql as default query format.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



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


[incubator-pinot] 01/01: Make sql as default query format.

Posted by xi...@apache.org.
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 <fx...@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-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org