Return a better error message when Timestamp is renamed in TS queries#136231
Return a better error message when Timestamp is renamed in TS queries#136231not-napoleon merged 34 commits intoelastic:mainfrom
Conversation
|
Hi @not-napoleon, I've created a changelog YAML for you. |
This isn't going to work because the objects get recreated arbitrarially.
…or-message' into rename-ts-error-message
Conflicts: x-pack/plugin/esql/qa/testFixtures/src/main/resources/k8s-timeseries.csv-spec x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java x-pack/plugin/src/yamlRestTest/resources/rest-api-spec/test/esql/40_tsdb.yml
…or-message' into rename-ts-error-message
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
Outdated
Show resolved
Hide resolved
…nged" This reverts commit dbcec93.
…or-message' into rename-ts-error-message
|
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
dnhatn
left a comment
There was a problem hiding this comment.
I left some nits, but this looks good. Can you also change to UnresolvedTimestamp for LastOverTime, FirstOverTime, Increase, Irate, Delta, and IDelta? Thank you, Mark!
| rx: | ||
| type: integer | ||
| time_series_metric: counter | ||
| index: test |
There was a problem hiding this comment.
this: nit: can we avoid reformatting this file?
| protected static Analyzer sampleDataIndexAnalyzer; | ||
|
|
||
| protected static EnrichResolution enrichResolution; | ||
| public static EnrichResolution enrichResolution; |
| required_capability: ts_command_v0 | ||
|
|
||
| TS k8s METADATA _tsid | ||
| | RENAME _tsid AS newTsid |
There was a problem hiding this comment.
Hmm, I think these queries should fail. You don't have to handle them in this PR.
There was a problem hiding this comment.
Yeah, we need to open a few follow up issues. There's also the case of shadowing timestamp in an eval that should fail.
|
|
||
| @Override | ||
| public UnresolvedTimestamp withUnresolvedMessage(String unresolvedMessage) { | ||
| return new UnresolvedTimestamp(source(), qualifier(), name(), id(), unresolvedMessage, resolutionMetadata(), errorMessage); |
There was a problem hiding this comment.
If you don't want to override String unresolvedMessage(), you can override unresolvedMessage here instead. Either approach is good.
Conflicts: x-pack/plugin/esql-core/src/main/java/org/elasticsearch/xpack/esql/core/expression/UnresolvedAttribute.java x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
Conflicts: x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
|
@elasticmachine run elasticsearch-ci/part-3 |
💔 Backport failed
You can use sqren/backport to manually backport by running |
…elastic#136231) Resolves elastic#134994 After discussing this more on elastic#136062, we have decided queries that rename the @timestamp field should fail with a clear error message. This relates to elastic#136772 --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> Conflicts: x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
…ueries (#136231) (#137112) * Return a better error message when Timestamp is renamed in TS queries (#136231) Resolves #134994 After discussing this more on #136062, we have decided queries that rename the @timestamp field should fail with a clear error message. This relates to #136772 --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co> Conflicts: x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java * creating test analyzers is fragile apparently * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
|
manual backport PR: #137112 |
…elastic#136231) Resolves elastic#134994 After discussing this more on elastic#136062, we have decided queries that rename the @timestamp field should fail with a clear error message. This relates to elastic#136772 --------- Co-authored-by: elasticsearchmachine <infra-root+elasticsearchmachine@elastic.co>
Resolves #134994
After discussing this more on #136062, we have decided queries that rename the
@timestampfield should fail with a clear error message.This relates to #136772