File tree Expand file tree Collapse file tree 2 files changed +3
-7
lines changed
main/java/org/elasticsearch/xpack/esql/parser
test/java/org/elasticsearch/xpack/esql/analysis Expand file tree Collapse file tree 2 files changed +3
-7
lines changed Original file line number Diff line number Diff 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 (),
Original file line number Diff line number Diff 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 () {
You can’t perform that action at this time.
0 commit comments