Skip to content

Commit c7cd50a

Browse files
Fix error message
1 parent b726351 commit c7cd50a

File tree

4 files changed

+3
-4
lines changed

4 files changed

+3
-4
lines changed

x-pack/plugin/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ tasks.named("yamlRestCompatTestTransform").configure({ task ->
134134
task.skipTest("esql/90_non_indexed/fetch", "Temporary until backported")
135135
task.skipTest("esql/63_enrich_int_range/Invalid age as double", "TODO: require disable allow_partial_results")
136136
task.skipTest("esql/191_lookup_join_on_datastreams/data streams not supported in LOOKUP JOIN", "Added support for aliases in JOINs")
137-
task.skipTest("esql/10_basic/Test wrong LIMIT parameter", "Different error message")
138137
task.skipTest("esql/190_lookup_join/non-lookup index", "Error message changed")
139138
task.skipTest("esql/192_lookup_join_on_aliases/alias-pattern-multiple", "Error message changed")
140139
})

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/parser/LogicalPlanBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ public PlanFactory visitLimitCommand(EsqlBaseParser.LimitCommandContext ctx) {
396396
"Invalid value for LIMIT ["
397397
+ BytesRefs.toString(val)
398398
+ ": "
399-
+ expression(ctx.constant()).dataType()
399+
+ (expression(ctx.constant()).dataType() == KEYWORD ? "String" : val.getClass().getSimpleName())
400400
+ "], expecting a non negative integer"
401401
);
402402
}

x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/ParsingTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public void testJoinTwiceOnTheSameField_TwoLookups() {
157157
}
158158

159159
public void testInvalidLimit() {
160-
assertEquals("1:13: Invalid value for LIMIT [foo: KEYWORD], expecting a non negative integer", error("row a = 1 | limit \"foo\""));
160+
assertEquals("1:13: Invalid value for LIMIT [foo: String], expecting a non negative integer", error("row a = 1 | limit \"foo\""));
161161
assertEquals("1:13: Invalid value for LIMIT [1.2: DOUBLE], expecting a non negative integer", error("row a = 1 | limit 1.2"));
162162
assertEquals("1:13: Invalid value for LIMIT [-1], expecting a non negative integer", error("row a = 1 | limit -1"));
163163
}

x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/10_basic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ FROM EVAL SORT LIMIT with documents_found:
553553
reason: "named or positional parameters for field names"
554554

555555
- do:
556-
catch: "/Invalid value for LIMIT \\[foo: KEYWORD\\], expecting a non negative integer/"
556+
catch: "/Invalid value for LIMIT \\[foo: String\\], expecting a non negative integer/"
557557
esql.query:
558558
body:
559559
query: 'from test | limit ?l'

0 commit comments

Comments
 (0)