You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/10/09 03:18:34 UTC

[GitHub] [druid] suneet-s commented on a change in pull request #10496: Web console: show segment sizes in rows not bytes

suneet-s commented on a change in pull request #10496:
URL: https://github.com/apache/druid/pull/10496#discussion_r502162405



##########
File path: web-console/src/utils/druid-query.ts
##########
@@ -92,12 +97,55 @@ export class DruidError extends Error {
     return;
   }
 
+  static getSuggestion(errorMessage: string): QuerySuggestion | undefined {
+    // == is used instead of =
+    if (errorMessage.includes('Encountered "= =" at')) {
+      return {
+        label: `Replace == with =`,
+        fn: str => {
+          if (!str.includes('==')) return;
+          return str.replace(/==/g, '=');
+        },
+      };
+    }
+
+    // Incorrect quoting on table
+    const mq = errorMessage.match(/Column '([^']+)' not found in any table/);
+    if (mq) {
+      const literalString = mq[1];
+      return {
+        label: `Replace "${literalString}" with '${literalString}'`,
+        fn: str => {
+          if (!str.includes(`"${literalString}"`)) return;
+          return str.replace(`"${literalString}"`, `'${literalString}'`);
+        },
+      };
+    }
+
+    // , before FROM
+    const mc = errorMessage.match(/Encountered "(FROM)" at/i);

Review comment:
       what does `mq` and `mc` stand for?




----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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