From 7396af3441dcb33e0c4037ca49c2e19889858f7d Mon Sep 17 00:00:00 2001 From: shuqi7 Date: Tue, 2 Apr 2019 14:45:34 -0700 Subject: [PATCH 1/7] Add explain for SQL query --- web-console/src/components/sql-control.scss | 8 ++ web-console/src/components/sql-control.tsx | 32 ++++-- web-console/src/utils/druid-query.tsx | 58 ++++++++++ web-console/src/views/sql-view.scss | 23 ++++ web-console/src/views/sql-view.tsx | 114 +++++++++++++++++++- 5 files changed, 222 insertions(+), 13 deletions(-) diff --git a/web-console/src/components/sql-control.scss b/web-console/src/components/sql-control.scss index f8ae7951382c..d061bf2e6650 100644 --- a/web-console/src/components/sql-control.scss +++ b/web-console/src/components/sql-control.scss @@ -40,6 +40,14 @@ .auto-complete-checkbox { margin:10px; min-width: 120px; + + .bp3-form-group { + margin-bottom: 0; + } + + button { + width: 100%; + } } .ace_tooltip { diff --git a/web-console/src/components/sql-control.tsx b/web-console/src/components/sql-control.tsx index 033944bd9a26..14a33693cbb6 100644 --- a/web-console/src/components/sql-control.tsx +++ b/web-console/src/components/sql-control.tsx @@ -16,7 +16,7 @@ * limitations under the License. */ -import { Button, Checkbox, Classes, Intent, Popover, Position } from "@blueprintjs/core"; +import { Button, Checkbox, Classes, Dialog, FormGroup, Intent, Popover, Position, TextArea } from "@blueprintjs/core"; import { IconNames } from "@blueprintjs/icons"; import axios from "axios"; import * as ace from 'brace'; @@ -39,6 +39,7 @@ const langTools = ace.acequire('ace/ext/language_tools'); export interface SqlControlProps extends React.Props { initSql: string | null; onRun: (query: string) => void; + onExplain: (query: string) => void; } export interface SqlControlState { @@ -165,18 +166,29 @@ export class SqlControl extends React.Component - this.setState({autoCompleteOn: !autoCompleteOn})} - /> + const morePopover =
+ + this.setState({autoCompleteOn: !autoCompleteOn})} + /> + + +
; // Set the key in the AceEditor to force a rebind and prevent an error that happens otherwise @@ -207,7 +219,7 @@ export class SqlControl extends React.Component onRun(query)}> {isRune ? 'Rune' : 'Run'} - +