-
Notifications
You must be signed in to change notification settings - Fork 917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[discover-next][bug] add back data set navigator to control state #7492
Changes from 15 commits
8a5faff
a526102
74b03e9
44b2fc1
f55c295
af2017b
2b5881b
9f49ce3
9f68352
3fff70e
27a74ab
bf057f2
254a7f2
b33c5b4
b575ca6
f66ef3b
65b9171
4d1ea50
a77b0db
b887914
666bae4
4a58eda
d5f5686
593541d
f37f782
729f0e3
b09c906
ca2b837
0964ec9
fef6156
861af9b
2f5ed13
6ff7e26
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,6 @@ | |
import { SqlErrorListener } from './sql_error_listerner'; | ||
import { findCursorTokenIndex } from '../shared/cursor'; | ||
import { openSearchSqlAutocompleteData } from './opensearch_sql_autocomplete'; | ||
import { getUiSettings } from '../../services'; | ||
import { SQL_SYMBOLS } from './constants'; | ||
import { QuerySuggestion, QuerySuggestionGetFnArgs } from '../../autocomplete'; | ||
import { fetchColumnValues, fetchTableSchemas } from '../shared/utils'; | ||
|
@@ -46,8 +45,8 @@ | |
query, | ||
services, | ||
}: QuerySuggestionGetFnArgs): Promise<QuerySuggestion[]> => { | ||
const { api } = services.uiSettings; | ||
const dataSetManager = services.data.query.dataSet; | ||
const suggestions = getOpenSearchSqlAutoCompleteSuggestions(query, { | ||
line: position?.lineNumber || selectionStart, | ||
column: position?.column || selectionEnd, | ||
|
@@ -59,12 +58,12 @@ | |
// Fetch columns and values | ||
if ('suggestColumns' in suggestions && (suggestions.suggestColumns?.tables?.length ?? 0) > 0) { | ||
const tableNames = suggestions.suggestColumns?.tables?.map((table) => table.name) ?? []; | ||
const schemas = await fetchTableSchemas(tableNames, api, services); | ||
|
||
schemas.forEach((schema) => { | ||
if (schema.body?.fields?.length > 0) { | ||
const columns = schema.body.fields.find((col: any) => col.name === 'COLUMN_NAME'); | ||
const fieldTypes = schema.body.fields.find((col: any) => col.name === 'DATA_TYPE'); | ||
if (columns && fieldTypes) { | ||
finalSuggestions.push( | ||
...columns.values.map((col: string, index: number) => ({ | ||
|
@@ -86,7 +85,7 @@ | |
tableNames, | ||
suggestions.suggestValuesForColumn as string, | ||
api, | ||
connectionService | ||
services | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. might need to remove these lines from here, since the other autocomplete prs were removed from this branch. this change was added in this commit, would only need to revert the changes done on this file: bf057f2#diff-f67c8b1b68c9ae8eeb8ea7d7dea38e59d32b7738dec7c9db5763cf74b96aa92fR46 |
||
); | ||
values.forEach((value) => { | ||
if (value.body?.fields?.length > 0) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we put this somewhere else?