Skip to content
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

fix: SQL Lab autocomplete for selected tables #19047

Merged
merged 1 commit into from
Mar 10, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -167,17 +167,17 @@ class AceEditorWrapper extends React.PureComponent<Props, State> {
meta: 'schema',
}));
const columns = {};
const tables = props.tables || [];
const extendedTables = props.extendedTables || [];
const tables = props.extendedTables || props.tables || [];

const tableWords = tables.map(t => {
const tableName = t.value;
const extendedTable = extendedTables.find(et => et.name === tableName);
const cols = (extendedTable && extendedTable.columns) || [];
const tableName = t.name;
const cols = t.columns || [];
cols.forEach(col => {
columns[col.name] = null; // using an object as a unique set
});

return {
name: t.label,
name: tableName,
value: tableName,
score: TABLE_AUTOCOMPLETE_SCORE,
meta: 'table',
Expand Down