Skip to content

Commit

Permalink
[ES|QL] Removes CCS check from the editor (#194903)
Browse files Browse the repository at this point in the history
## Summary

Removes the CCS check from the editor. We support now cross cluster
queries so this was a leftover. I also tested it with the oblt clusters
to ensure that our validation works as expected.
  • Loading branch information
stratoula authored Oct 7, 2024
1 parent ad986d4 commit b4ba131
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,6 @@ export function isVariable(
): column is ESQLVariable {
return Boolean(column && 'location' in column);
}
export function hasCCSSource(name: string) {
return name.includes(':');
}

/**
* This will return the name without any quotes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => {
await expectErrors('fRoM in*ex', []);
await expectErrors('fRoM ind*ex', []);
await expectErrors('fRoM *,-.*', []);
await expectErrors('fRoM remote-*:indexes*', []);
await expectErrors('fRoM remote-*:indexes', []);
await expectErrors('fRoM remote-ccs:indexes', []);
await expectErrors('fRoM a_index, remote-ccs:indexes', []);
await expectErrors('fRoM remote-*:indexes*', ['Unknown index [remote-*:indexes*]']);
await expectErrors('fRoM remote-*:indexes', ['Unknown index [remote-*:indexes]']);
await expectErrors('fRoM remote-ccs:indexes', ['Unknown index [remote-ccs:indexes]']);
await expectErrors('fRoM a_index, remote-ccs:indexes', [
'Unknown index [remote-ccs:indexes]',
]);
await expectErrors('fRoM .secret_index', []);
await expectErrors('from my-index', []);
});
Expand Down Expand Up @@ -151,12 +153,12 @@ export const validationFromCommandTestSuite = (setup: helpers.Setup) => {
);
await expectErrors(
`from remote-ccs:indexes ${setWrapping('METADATA _id')}`,
[],
['Unknown index [remote-ccs:indexes]'],
addBracketsWarning()
);
await expectErrors(
`from *:indexes ${setWrapping('METADATA _id')}`,
[],
['Unknown index [*:indexes]'],
addBracketsWarning()
);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ export const validationMetricsCommandTestSuite = (setup: helpers.Setup) => {
await expectErrors('metrics in*ex', []);
await expectErrors('metrics ind*ex', []);
await expectErrors('metrics *,-.*', []);
await expectErrors('metrics remote-*:indexes*', []);
await expectErrors('metrics remote-*:indexes', []);
await expectErrors('metrics remote-ccs:indexes', []);
await expectErrors('metrics a_index, remote-ccs:indexes', []);
await expectErrors('metrics remote-*:indexes*', ['Unknown index [remote-*:indexes*]']);
await expectErrors('metrics remote-*:indexes', ['Unknown index [remote-*:indexes]']);
await expectErrors('metrics remote-ccs:indexes', [
'Unknown index [remote-ccs:indexes]',
]);
await expectErrors('metrics a_index, remote-ccs:indexes', [
'Unknown index [remote-ccs:indexes]',
]);
await expectErrors('metrics .secret_index', []);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import {
sourceExists,
getColumnExists,
hasWildcard,
hasCCSSource,
isSettingItem,
isAssignment,
isVariable,
Expand Down Expand Up @@ -815,11 +814,6 @@ function validateSource(
return messages;
}

const hasCCS = hasCCSSource(source.name);
if (hasCCS) {
return messages;
}

const commandDef = getCommandDefinition(commandName);
const isWildcardAndNotSupported =
hasWildcard(source.name) && !commandDef.signature.params.some(({ wildcards }) => wildcards);
Expand Down

0 comments on commit b4ba131

Please sign in to comment.