You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by ab...@apache.org on 2022/08/31 12:05:12 UTC

[druid] branch 24.0.0 updated: don't show transform actions on * queries (#13005)

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

abhishek pushed a commit to branch 24.0.0
in repository https://gitbox.apache.org/repos/asf/druid.git


The following commit(s) were added to refs/heads/24.0.0 by this push:
     new da1e8d58ec don't show transform actions on * queries (#13005)
da1e8d58ec is described below

commit da1e8d58ec58165bc6705c1bf056f091fcb51677
Author: Vadim Ogievetsky <va...@ogievetsky.com>
AuthorDate: Tue Aug 30 21:54:18 2022 -0700

    don't show transform actions on * queries (#13005)
---
 .../views/query-view/query-output/query-output.tsx | 29 +++++++++++-----------
 .../result-table-pane/result-table-pane.tsx        | 26 ++++++++++---------
 2 files changed, 29 insertions(+), 26 deletions(-)

diff --git a/web-console/src/views/query-view/query-output/query-output.tsx b/web-console/src/views/query-view/query-output/query-output.tsx
index db57d1b0b5..8410f602ed 100644
--- a/web-console/src/views/query-view/query-output/query-output.tsx
+++ b/web-console/src/views/query-view/query-output/query-output.tsx
@@ -152,23 +152,24 @@ export const QueryOutput = React.memo(function QueryOutput(props: QueryOutputPro
       }
 
       if (!parsedQuery.hasStarInSelect()) {
-        basicActions.push({
-          icon: IconNames.EDIT,
-          title: `Rename column`,
-          onAction: () => {
-            setRenamingColumn(headerIndex);
+        basicActions.push(
+          {
+            icon: IconNames.EDIT,
+            title: 'Rename column',
+            onAction: () => {
+              setRenamingColumn(headerIndex);
+            },
           },
-        });
+          {
+            icon: IconNames.CROSS,
+            title: 'Remove column',
+            onAction: () => {
+              onQueryAction(q => q.removeOutputColumn(header));
+            },
+          },
+        );
       }
 
-      basicActions.push({
-        icon: IconNames.CROSS,
-        title: `Remove column`,
-        onAction: () => {
-          onQueryAction(q => q.removeOutputColumn(header));
-        },
-      });
-
       return basicActionsToMenu(basicActions)!;
     } else {
       const orderByExpression = SqlRef.column(header);
diff --git a/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx b/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx
index 3917a12a1a..e4b78b5af7 100644
--- a/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx
+++ b/web-console/src/views/workbench-view/result-table-pane/result-table-pane.tsx
@@ -244,7 +244,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
       }
 
       // JSON hint
-      if (column.nativeType === 'COMPLEX<json>') {
+      if (selectExpression && column.nativeType === 'COMPLEX<json>') {
         const paths = getJsonPaths(
           filterMap(queryResult.rows, row => {
             const v = row[headerIndex];
@@ -319,7 +319,7 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
         }
       }
 
-      if (!parsedQuery.hasStarInSelect()) {
+      if (noStar) {
         menuItems.push(
           <MenuItem
             key="edit_column"
@@ -487,16 +487,18 @@ export const ResultTablePane = React.memo(function ResultTablePane(props: Result
         }
       }
 
-      menuItems.push(
-        <MenuItem
-          key="remove_column"
-          icon={IconNames.CROSS}
-          text="Remove column"
-          onClick={() => {
-            onQueryAction(q => q.removeOutputColumn(header));
-          }}
-        />,
-      );
+      if (noStar) {
+        menuItems.push(
+          <MenuItem
+            key="remove_column"
+            icon={IconNames.CROSS}
+            text="Remove column"
+            onClick={() => {
+              onQueryAction(q => q.removeOutputColumn(header));
+            }}
+          />,
+        );
+      }
     } else {
       menuItems.push(
         <MenuItem


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