Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions web-console/src/views/query-view/query-input/query-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { ResizeEntry } from '@blueprintjs/core';
import { ResizeSensor2 } from '@blueprintjs/popover2';
import type { Ace } from 'ace-builds';
import ace from 'ace-builds';
import { SqlRef, SqlTableRef } from 'druid-query-toolkit';
import escape from 'lodash.escape';
import React from 'react';
import AceEditor from 'react-ace';
Expand Down Expand Up @@ -150,7 +151,7 @@ export class QueryInput extends React.PureComponent<QueryInputProps, QueryInputS
) {
const completions = ([] as any[]).concat(
uniq(columnMetadata.map(d => d.TABLE_SCHEMA)).map(v => ({
value: v,
value: SqlTableRef.create(v).toString(),
score: 10,
meta: 'schema',
})),
Expand All @@ -159,7 +160,7 @@ export class QueryInput extends React.PureComponent<QueryInputProps, QueryInputS
.filter(d => (currentSchema ? d.TABLE_SCHEMA === currentSchema : true))
.map(d => d.TABLE_NAME),
).map(v => ({
value: v,
value: SqlTableRef.create(v).toString(),
score: 49,
meta: 'datasource',
})),
Expand All @@ -172,7 +173,7 @@ export class QueryInput extends React.PureComponent<QueryInputProps, QueryInputS
)
.map(d => d.COLUMN_NAME),
).map(v => ({
value: v,
value: SqlRef.column(v).toString(),
score: 50,
meta: 'column',
})),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ResizeSensor2 } from '@blueprintjs/popover2';
import type { Ace } from 'ace-builds';
import ace from 'ace-builds';
import classNames from 'classnames';
import { SqlRef, SqlTableRef } from 'druid-query-toolkit';
import escape from 'lodash.escape';
import React from 'react';
import AceEditor from 'react-ace';
Expand Down Expand Up @@ -163,7 +164,7 @@ export class FlexibleQueryInput extends React.PureComponent<
) {
const completions = ([] as any[]).concat(
uniq(columnMetadata.map(d => d.TABLE_SCHEMA)).map(v => ({
value: v,
value: SqlTableRef.create(v).toString(),
score: 10,
meta: 'schema',
})),
Expand All @@ -172,7 +173,7 @@ export class FlexibleQueryInput extends React.PureComponent<
.filter(d => (currentSchema ? d.TABLE_SCHEMA === currentSchema : true))
.map(d => d.TABLE_NAME),
).map(v => ({
value: v,
value: SqlTableRef.create(v).toString(),
score: 49,
meta: 'datasource',
})),
Expand All @@ -185,7 +186,7 @@ export class FlexibleQueryInput extends React.PureComponent<
)
.map(d => d.COLUMN_NAME),
).map(v => ({
value: v,
value: SqlRef.column(v).toString(),
score: 50,
meta: 'column',
})),
Expand Down