File tree Expand file tree Collapse file tree 2 files changed +7
-3
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 +7
-3
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,9 @@ public PlanFactory visitEnrichCommand(EsqlBaseParser.EnrichCommandContext ctx) {
445
445
public PlanFactory visitChangePointCommand (EsqlBaseParser .ChangePointCommandContext ctx ) {
446
446
Source src = source (ctx );
447
447
NamedExpression value = visitQualifiedName (ctx .value );
448
- NamedExpression key = ctx .key == null ? new UnresolvedAttribute (src , "@timestamp" ) : visitQualifiedName (ctx .key );
448
+ NamedExpression key = ctx .key == null
449
+ ? new UnresolvedAttribute (src , "@timestamp" , "Key column unspecified and default [@timestamp] is missing" )
450
+ : visitQualifiedName (ctx .key );
449
451
Attribute targetType = new ReferenceAttribute (
450
452
src ,
451
453
ctx .targetType == null ? "type" : visitQualifiedName (ctx .targetType ).name (),
Original file line number Diff line number Diff line change @@ -2021,8 +2021,10 @@ public void testChangePoint() {
2021
2021
var airports = AnalyzerTestUtils .analyzer (loadMapping ("mapping-airports.json" , "airports" ));
2022
2022
assertEquals ("1:30: Unknown column [blahblah]" , error ("FROM airports | CHANGE_POINT blahblah ON scalerank" , airports ));
2023
2023
assertEquals ("1:43: Unknown column [blahblah]" , error ("FROM airports | CHANGE_POINT scalerank ON blahblah" , airports ));
2024
- // TODO: nicer error message for missing default column "@timestamp"
2025
- assertEquals ("1:17: Unknown column [@timestamp]" , error ("FROM airports | CHANGE_POINT scalerank" , airports ));
2024
+ assertEquals (
2025
+ "1:17: Key column unspecified and default [@timestamp] is missing" ,
2026
+ error ("FROM airports | CHANGE_POINT scalerank" , airports )
2027
+ );
2026
2028
}
2027
2029
2028
2030
public void testChangePoint_keySortable () {
You can’t perform that action at this time.
0 commit comments