From 8a4b15002586548067659da3a055e3977a018777 Mon Sep 17 00:00:00 2001 From: carlosdelest Date: Thu, 12 Sep 2024 16:52:36 +0200 Subject: [PATCH] Chanage error messages to start with lowercase --- .../xpack/esql/analysis/Verifier.java | 4 +- .../xpack/esql/analysis/VerifierTests.java | 42 +++++++++---------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java index f5725d3747b0e..87efa883af74d 100644 --- a/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java +++ b/x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Verifier.java @@ -672,7 +672,7 @@ private static void checkFullTextQueryFunctions(LogicalPlan plan, Set f failures.add( fail( plan, - "Full text functions cannot be used after {}", + "full text functions cannot be used after {}", lp.sourceText().split(" ")[0].toUpperCase(Locale.ROOT) ) ); @@ -681,7 +681,7 @@ private static void checkFullTextQueryFunctions(LogicalPlan plan, Set f } } else { plan.forEachExpression(FullTextFunction.class, ftf -> { - failures.add(fail(ftf, "Full text functions are only supported in WHERE commands")); + failures.add(fail(ftf, "full text functions are only supported in WHERE commands")); }); } } diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java index 9422697691b76..56c2568b5bccf 100644 --- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java +++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java @@ -1094,58 +1094,58 @@ public void testQueryStringFunctionsNotAllowedAfterCommands() throws Exception { assumeTrue("skipping because QSTR is not enabled", EsqlCapabilities.Cap.QSTR_FUNCTION.isEnabled()); // Source commands - assertEquals("1:13: Full text functions cannot be used after SHOW", error("show info | where qstr(\"8.16.0\")")); - assertEquals("1:17: Full text functions cannot be used after ROW", error("row a= \"Anna\" | where qstr(\"Anna\")")); + assertEquals("1:13: full text functions cannot be used after SHOW", error("show info | where qstr(\"8.16.0\")")); + assertEquals("1:17: full text functions cannot be used after ROW", error("row a= \"Anna\" | where qstr(\"Anna\")")); // Processing commands assertEquals( - "1:43: Full text functions cannot be used after DISSECT", + "1:43: full text functions cannot be used after DISSECT", error("from test | dissect first_name \"%{foo}\" | where qstr(\"Connection\")") ); - assertEquals("1:27: Full text functions cannot be used after DROP", error("from test | drop emp_no | where qstr(\"Anna\")")); + assertEquals("1:27: full text functions cannot be used after DROP", error("from test | drop emp_no | where qstr(\"Anna\")")); assertEquals( - "1:71: Full text functions cannot be used after ENRICH", + "1:71: full text functions cannot be used after ENRICH", error("from test | enrich languages on languages with lang = language_name | where qstr(\"Anna\")") ); - assertEquals("1:26: Full text functions cannot be used after EVAL", error("from test | eval z = 2 | where qstr(\"Anna\")")); + assertEquals("1:26: full text functions cannot be used after EVAL", error("from test | eval z = 2 | where qstr(\"Anna\")")); assertEquals( - "1:44: Full text functions cannot be used after GROK", + "1:44: full text functions cannot be used after GROK", error("from test | grok last_name \"%{WORD:foo}\" | where qstr(\"Anna\")") ); - assertEquals("1:27: Full text functions cannot be used after KEEP", error("from test | keep emp_no | where qstr(\"Anna\")")); - assertEquals("1:24: Full text functions cannot be used after LIMIT", error("from test | limit 10 | where qstr(\"Anna\")")); + assertEquals("1:27: full text functions cannot be used after KEEP", error("from test | keep emp_no | where qstr(\"Anna\")")); + assertEquals("1:24: full text functions cannot be used after LIMIT", error("from test | limit 10 | where qstr(\"Anna\")")); assertEquals( - "1:35: Full text functions cannot be used after MV_EXPAND", + "1:35: full text functions cannot be used after MV_EXPAND", error("from test | mv_expand last_name | where qstr(\"Anna\")") ); assertEquals( - "1:45: Full text functions cannot be used after RENAME", + "1:45: full text functions cannot be used after RENAME", error("from test | rename last_name as full_name | where qstr(\"Anna\")") ); assertEquals( - "1:52: Full text functions cannot be used after STATS", + "1:52: full text functions cannot be used after STATS", error("from test | STATS c = COUNT(emp_no) BY languages | where qstr(\"Anna\")") ); // Some combination of processing commands assertEquals( - "1:38: Full text functions cannot be used after LIMIT", + "1:38: full text functions cannot be used after LIMIT", error("from test | keep emp_no | limit 10 | where qstr(\"Anna\")") ); assertEquals( - "1:46: Full text functions cannot be used after MV_EXPAND", + "1:46: full text functions cannot be used after MV_EXPAND", error("from test | limit 10 | mv_expand last_name | where qstr(\"Anna\")") ); assertEquals( - "1:52: Full text functions cannot be used after KEEP", + "1:52: full text functions cannot be used after KEEP", error("from test | mv_expand last_name | keep last_name | where qstr(\"Anna\")") ); assertEquals( - "1:77: Full text functions cannot be used after RENAME", + "1:77: full text functions cannot be used after RENAME", error("from test | STATS c = COUNT(emp_no) BY languages | rename c as total_emps | where qstr(\"Anna\")") ); assertEquals( - "1:54: Full text functions cannot be used after KEEP", + "1:54: full text functions cannot be used after KEEP", error("from test | rename last_name as name | keep emp_no | where qstr(\"Anna\")") ); } @@ -1153,11 +1153,11 @@ public void testQueryStringFunctionsNotAllowedAfterCommands() throws Exception { public void testQueryStringFunctionsOnlyAllowedInWhere() throws Exception { assumeTrue("skipping because QSTR is not enabled", EsqlCapabilities.Cap.QSTR_FUNCTION.isEnabled()); - assertEquals("1:22: Full text functions are only supported in WHERE commands", error("from test | eval y = qstr(\"Anna\")")); - assertEquals("1:18: Full text functions are only supported in WHERE commands", error("from test | sort qstr(\"Connection\") asc")); - assertEquals("1:5: Full text functions are only supported in WHERE commands", error("row qstr(\"Connection\")")); + assertEquals("1:22: full text functions are only supported in WHERE commands", error("from test | eval y = qstr(\"Anna\")")); + assertEquals("1:18: full text functions are only supported in WHERE commands", error("from test | sort qstr(\"Connection\") asc")); + assertEquals("1:5: full text functions are only supported in WHERE commands", error("row qstr(\"Connection\")")); assertEquals( - "1:23: Full text functions are only supported in WHERE commands", + "1:23: full text functions are only supported in WHERE commands", error("from test | STATS c = qstr(\"foo\") BY languages") ); }