Skip to content

Commit 1d3e362

Browse files
committed
Revert "better error msg"
This reverts commit 21ec77c.
1 parent 21ec77c commit 1d3e362

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,9 +445,7 @@ public PlanFactory visitEnrichCommand(EsqlBaseParser.EnrichCommandContext ctx) {
445445
public PlanFactory visitChangePointCommand(EsqlBaseParser.ChangePointCommandContext ctx) {
446446
Source src = source(ctx);
447447
NamedExpression value = visitQualifiedName(ctx.value);
448-
NamedExpression key = ctx.key == null
449-
? new UnresolvedAttribute(src, "@timestamp", "Key column unspecified and default [@timestamp] is missing")
450-
: visitQualifiedName(ctx.key);
448+
NamedExpression key = ctx.key == null ? new UnresolvedAttribute(src, "@timestamp") : visitQualifiedName(ctx.key);
451449
Attribute targetType = new ReferenceAttribute(
452450
src,
453451
ctx.targetType == null ? "type" : visitQualifiedName(ctx.targetType).name(),

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,10 +2021,8 @@ public void testChangePoint() {
20212021
var airports = AnalyzerTestUtils.analyzer(loadMapping("mapping-airports.json", "airports"));
20222022
assertEquals("1:30: Unknown column [blahblah]", error("FROM airports | CHANGE_POINT blahblah ON scalerank", airports));
20232023
assertEquals("1:43: Unknown column [blahblah]", error("FROM airports | CHANGE_POINT scalerank ON blahblah", airports));
2024-
assertEquals(
2025-
"1:17: Key column unspecified and default [@timestamp] is missing",
2026-
error("FROM airports | CHANGE_POINT scalerank", airports)
2027-
);
2024+
// TODO: nicer error message for missing default column "@timestamp"
2025+
assertEquals("1:17: Unknown column [@timestamp]", error("FROM airports | CHANGE_POINT scalerank", airports));
20282026
}
20292027

20302028
public void testChangePoint_keySortable() {

0 commit comments

Comments
 (0)