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

[ES|QL] Remove CCS validation #175124

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions packages/kbn-monaco/src/esql/lib/ast/validation/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,6 @@ function getMessageAndTypeFromId<K extends ErrorTypes>({
},
}),
};
case 'ccsNotSupportedForCommand':
return {
message: i18n.translate('monaco.esql.validation.ccsNotSupportedForCommand', {
defaultMessage: 'ES|QL does not yet support querying remote indices [{value}]',
values: {
value: out.value,
},
}),
};
case 'unsupportedFieldType':
return {
message: i18n.translate('monaco.esql.validation.unsupportedFieldType', {
Expand Down
4 changes: 0 additions & 4 deletions packages/kbn-monaco/src/esql/lib/ast/validation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ export interface ValidationErrors {
message: string;
type: { name: string };
};
ccsNotSupportedForCommand: {
message: string;
type: { value: string };
};
unsupportedFieldType: {
message: string;
type: { field: string };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,24 +272,12 @@ describe('validation logic', () => {
testErrorsAndWarnings(`from ind*ex`, []);
testErrorsAndWarnings(`from indexes*`, ['Unknown index [indexes*]']);

testErrorsAndWarnings(`from remote-*:indexes*`, [
'ES|QL does not yet support querying remote indices [remote-*:indexes*]',
]);
testErrorsAndWarnings(`from remote-*:indexes`, [
'ES|QL does not yet support querying remote indices [remote-*:indexes]',
]);
testErrorsAndWarnings(`from remote-ccs:indexes`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from a, remote-ccs:indexes`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from remote-ccs:indexes [METADATA _id]`, [
'ES|QL does not yet support querying remote indices [remote-ccs:indexes]',
]);
testErrorsAndWarnings(`from *:indexes [METADATA _id]`, [
'ES|QL does not yet support querying remote indices [*:indexes]',
]);
testErrorsAndWarnings(`from remote-*:indexes*`, []);
testErrorsAndWarnings(`from remote-*:indexes`, []);
testErrorsAndWarnings(`from remote-ccs:indexes`, []);
testErrorsAndWarnings(`from a, remote-ccs:indexes`, []);
testErrorsAndWarnings(`from remote-ccs:indexes [METADATA _id]`, []);
testErrorsAndWarnings(`from *:indexes [METADATA _id]`, []);
testErrorsAndWarnings('from .secretIndex', []);
testErrorsAndWarnings('from my-index', []);
});
Expand Down
11 changes: 2 additions & 9 deletions packages/kbn-monaco/src/esql/lib/ast/validation/validation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,16 +482,9 @@ function validateSource(
})
);
} else {
// give up on validate if CCS for now
const hasCCS = hasCCSSource(source.name);
if (hasCCS) {
messages.push(
getMessageFromId({
messageId: 'ccsNotSupportedForCommand',
values: { value: source.name },
locations: source.location,
})
);
} else {
if (!hasCCS) {
const isWildcardAndNotSupported =
hasWildcard(source.name) && !commandDef.signature.params.some(({ wildcards }) => wildcards);
if (isWildcardAndNotSupported) {
Expand Down