jadami10 commented on a change in pull request #7165:
URL: https://github.com/apache/incubator-pinot/pull/7165#discussion_r670761262



##########
File path: pinot-controller/src/main/resources/app/utils/PinotMethodUtils.ts
##########
@@ -301,13 +303,13 @@ const getQueryResults = (params, url, checkedOptions) => {
       },
       queryStats: {
         columns: columnStats,
-        records: [[data.timeUsedMs, data.numDocsScanned, data.totalDocs, 
data.numServersQueried, data.numServersResponded,

Review comment:
       `data = JSONbig.parse(data)` was only added recently, so I'm not really 
sure how this was working before. But now this just reuses the `queryResponse` 
object

##########
File path: pinot-controller/src/main/resources/app/utils/PinotMethodUtils.ts
##########
@@ -209,7 +209,11 @@ const getTableSchemaData = (tableName) => {
 
 const getAsObject = (str: SQLResult) => {
   if (typeof str === 'string' || str instanceof String) {
-    return JSON.parse(JSON.stringify(str));
+    try {
+      return JSONbig.parse(str);
+    } catch(e) {
+      return JSON.parse(JSON.stringify(str));
+    }

Review comment:
       I do wonder if this is even necessary now. JSON.parse is nice because it 
returns the string when it fails But I wonder if we should just swallow the 
exception and return the string below. I do think I prefer it like this since 
there's no test coverage, and I'm not sure what the expectation was here.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to