Skip to content

Commit

Permalink
fix autocomplete (#19047)
Browse files Browse the repository at this point in the history
(cherry picked from commit a21d8a0)
  • Loading branch information
hughhhh authored and villebro committed Apr 3, 2022
1 parent 0aba34a commit 2c151f3
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,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

0 comments on commit 2c151f3

Please sign in to comment.