mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[ES|QL] Removes CCS check from the editor (#194903)
## 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.
This commit is contained in:
parent
ad986d4c26
commit
b4ba131409
4 changed files with 16 additions and 19 deletions
|
@ -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.
|
||||
|
|
|
@ -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', []);
|
||||
});
|
||||
|
@ -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()
|
||||
);
|
||||
});
|
||||
|
|
|
@ -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', []);
|
||||
});
|
||||
|
||||
|
|
|
@ -47,7 +47,6 @@ import {
|
|||
sourceExists,
|
||||
getColumnExists,
|
||||
hasWildcard,
|
||||
hasCCSSource,
|
||||
isSettingItem,
|
||||
isAssignment,
|
||||
isVariable,
|
||||
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue