Skip to content

Commit

Permalink
ESQL: Entirely remove META FUNCTIONS (#113967) (#114342)
Browse files Browse the repository at this point in the history
This removes the undocumented `META FUNCTIONS` command that emits
descriptions for all functions. This shouldn't be used because we never
told anyone about it. I'd have preferred if we'd have explicitly
documented it as no public or if we'd have left it snapshot-only. But
sometimes you make a mistake. I'm hopeful no one is relying on it. It
was never reliable and not public.....
  • Loading branch information
nik9000 authored Oct 9, 2024
1 parent 69e88f3 commit 67ce8bd
Show file tree
Hide file tree
Showing 29 changed files with 2,038 additions and 3,051 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@
"Cluster and node setting",
"Command line tool",
"CRUD",
"ES|QL",
"Index setting",
"Ingest",
"JVM option",
Expand Down
13 changes: 13 additions & 0 deletions docs/changelog/113967.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
pr: 113967
summary: "ESQL: Entirely remove META FUNCTIONS"
area: ES|QL
type: breaking
issues: []
breaking:
title: "ESQL: Entirely remove META FUNCTIONS"
area: ES|QL
details: |
Removes an undocumented syntax from ESQL: META FUNCTION. This was never
reliable or really useful. Consult the documentation instead.
impact: "Removes an undocumented syntax from ESQL: META FUNCTION"
notable: false
3 changes: 1 addition & 2 deletions docs/reference/rest-api/usage.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,7 @@ GET /_xpack/usage
"keep" : 0,
"enrich" : 0,
"from" : 0,
"row" : 0,
"meta" : 0
"row" : 0
},
"queries" : {
"rest" : {
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,6 @@ tasks.named("precommit").configure {
tasks.named("yamlRestTestV7CompatTransform").configure({ task ->
task.skipTest("security/10_forbidden/Test bulk response with invalid credentials", "warning does not exist for compatibility")
task.skipTest("inference/inference_crud/Test get all", "Assertions on number of inference models break due to default configs")
task.skipTest("esql/60_usage/Basic ESQL usage output (telemetry)", "The telemetry output changed. We dropped a column. That's safe.")
})

Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ public MixedClusterEsqlSpecIT(
protected void shouldSkipTest(String testName) throws IOException {
super.shouldSkipTest(testName);
assumeTrue("Test " + testName + " is skipped on " + bwcVersion, isEnabled(testName, instructions, bwcVersion));
assumeFalse(
"Skip META tests on mixed version clusters because we change it too quickly",
testCase.requiredCapabilities.contains("meta")
);
if (mode == ASYNC) {
assumeTrue("Async is not supported on " + bwcVersion, supportsAsync());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,6 @@ protected void shouldSkipTest(String testName) throws IOException {
);
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains("inlinestats"));
assumeFalse("INLINESTATS not yet supported in CCS", testCase.requiredCapabilities.contains("inlinestats_v2"));
assumeFalse(
"Skip META tests on mixed version clusters because we change it too quickly",
testCase.requiredCapabilities.contains("meta")
);
}

private TestFeatureService remoteFeaturesService() throws IOException {
Expand Down
552 changes: 0 additions & 552 deletions x-pack/plugin/esql/qa/testFixtures/src/main/resources/meta.csv-spec

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import org.elasticsearch.xpack.core.esql.action.ColumnInfo;
import org.elasticsearch.xpack.esql.VerificationException;
import org.elasticsearch.xpack.esql.core.type.DataType;
import org.elasticsearch.xpack.esql.expression.function.EsqlFunctionRegistry;
import org.elasticsearch.xpack.esql.parser.ParsingException;
import org.elasticsearch.xpack.esql.plugin.EsqlPlugin;
import org.junit.Before;
Expand Down Expand Up @@ -1038,29 +1037,6 @@ public void testShowInfo() {
}
}

public void testMetaFunctions() {
try (EsqlQueryResponse results = run("meta functions")) {
assertThat(
results.columns(),
equalTo(
List.of(
new ColumnInfoImpl("name", "keyword"),
new ColumnInfoImpl("synopsis", "keyword"),
new ColumnInfoImpl("argNames", "keyword"),
new ColumnInfoImpl("argTypes", "keyword"),
new ColumnInfoImpl("argDescriptions", "keyword"),
new ColumnInfoImpl("returnType", "keyword"),
new ColumnInfoImpl("description", "keyword"),
new ColumnInfoImpl("optionalArgs", "boolean"),
new ColumnInfoImpl("variadic", "boolean"),
new ColumnInfoImpl("isAggregation", "boolean")
)
)
);
assertThat(getValuesList(results).size(), equalTo(new EsqlFunctionRegistry().listFunctions().size()));
}
}

public void testInWithNullValue() {
try (EsqlQueryResponse results = run("from test | where null in (data, 2) | keep data")) {
assertThat(results.columns(), equalTo(List.of(new ColumnInfoImpl("data", "long"))));
Expand Down
21 changes: 0 additions & 21 deletions x-pack/plugin/esql/src/main/antlr/EsqlBaseLexer.g4
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ FROM : 'from' -> pushMode(FROM_MODE);
GROK : 'grok' -> pushMode(EXPRESSION_MODE);
KEEP : 'keep' -> pushMode(PROJECT_MODE);
LIMIT : 'limit' -> pushMode(EXPRESSION_MODE);
META : 'meta' -> pushMode(META_MODE);
MV_EXPAND : 'mv_expand' -> pushMode(MVEXPAND_MODE);
RENAME : 'rename' -> pushMode(RENAME_MODE);
ROW : 'row' -> pushMode(EXPRESSION_MODE);
Expand Down Expand Up @@ -467,26 +466,6 @@ SHOW_WS
: WS -> channel(HIDDEN)
;

//
// META commands
//
mode META_MODE;
META_PIPE : PIPE -> type(PIPE), popMode;

FUNCTIONS : 'functions';

META_LINE_COMMENT
: LINE_COMMENT -> channel(HIDDEN)
;

META_MULTILINE_COMMENT
: MULTILINE_COMMENT -> channel(HIDDEN)
;

META_WS
: WS -> channel(HIDDEN)
;

mode SETTING_MODE;
SETTING_CLOSING_BRACKET : CLOSING_BRACKET -> type(CLOSING_BRACKET), popMode;

Expand Down
Loading

0 comments on commit 67ce8bd

Please sign in to comment.