[ES|QL] To_DatePeriod and To_TimeDuration return better error messages on union_type fields#114934
Conversation
|
Hi @fang-xing-esql, I've created a changelog YAML for you. |
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
alex-spies
left a comment
There was a problem hiding this comment.
Thanks @fang-xing-esql !
This nearly LGTM and I have mostly minor comments; the only, slightly not-so-minor remark is that we shouldn't use UnsupportedAttribute here as that has a pretty specific meaning and treatment in both the verifier and compute engine.
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
Outdated
Show resolved
Hide resolved
...rg/elasticsearch/xpack/esql/expression/function/scalar/convert/FoldablesConvertFunction.java
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/analysis/Analyzer.java
Outdated
Show resolved
Hide resolved
| new UnsupportedEsField(imf.getName(), types), | ||
| unresolvedMessage | ||
| ); | ||
| return fcf.replaceChildren(Collections.singletonList(ua)); |
There was a problem hiding this comment.
bikeshed: we could probably also replace the whole convert function by an UnresolvedAttribute (with the custom message from above); probably irrelevant for the final verification, though.
There was a problem hiding this comment.
I'd prefer to keep the function name, not revert it back to UnresolvedFunction, as ResolveFunctions has done its job, and it is correct. The conversion function's name has been resolved by ResolveFunctions, however its children haven't been resolved yet.
x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/analysis/VerifierTests.java
Outdated
Show resolved
Hide resolved
|
Thanks for reviewing @alex-spies ! The comments have been addressed in the last commit. |
|
@elasticmachine update branch |
|
@elasticmachine update branch |
💔 Backport failedThe backport operation could not be completed due to the following error: You can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…s on union_type fields (elastic#114934) * better error messages with union_type fields (cherry picked from commit eb6d47f)
…s on union_type fields (#114934) * better error messages with union_type fields
…s on union_type fields (elastic#114934) * better error messages with union_type fields
…s on union_type fields (elastic#114934) * better error messages with union_type fields
Resolves: #112668