-
Notifications
You must be signed in to change notification settings - Fork 25.3k
ESQL: Begin documenting MV behaviors on non-aggs #123917
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Most functions turn multivalue fields into `null`, but a few "obvious" ones do the "obvious" things. This starts to document these behaviors.
Pinging @elastic/es-docs (Team:Docs) |
Pinging @elastic/es-analytical-engine (Team:Analytics) |
@@ -164,7 +164,9 @@ public static Part resolve(String dateTimeUnit) { | |||
examples = { @Example(file = "date", tag = "docsDateDiff"), @Example(description = """ | |||
When subtracting in calendar units - like year, month a.s.o. - only the fully elapsed units are counted. | |||
To avoid this and obtain also remainders, simply switch to the next smaller unit and do the date math accordingly. | |||
""", file = "date", tag = "evalDateDiffYearForDocs") } | |||
""", file = "date", tag = "evalDateDiffYearForDocs"), @Example(description = """ | |||
If any column is multivalued, this will return a `null` result. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd been considering this behavior to be "undefined" but the null-and-warning
behavior as something we may change in the future. I'm not sure that that's really true though - folks may be relying on it even though it's a warning.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't update the docs because they docs are currently frozen for migration to the new docs system. But this updates the bits that generate the docs.
@@ -35,7 +35,8 @@ | |||
import static org.elasticsearch.xpack.esql.core.type.DataType.NULL; | |||
|
|||
/** | |||
* Returns the minimum value of multiple columns. | |||
* Returns the minimum value of multiple columns. This will correctly return the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this doc change be reflected in the FunctionInfo.description
instead? Same for Greatest
@@ -54,7 +54,7 @@ public class DateFormat extends EsqlConfigurationFunction implements OptionalArg | |||
@FunctionInfo( | |||
returnType = "keyword", | |||
description = "Returns a string representation of a date, in the provided format.", | |||
examples = @Example(file = "date", tag = "docsDateFormat") | |||
examples = { @Example(file = "date", tag = "docsDateFormat"), @Example(file = "date", tag = "docsDateFormat"), } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both examples are identical. Wrong tag?
Most functions turn multivalue fields into
null
, but a few "obvious" ones do the "obvious" things. This starts to document these behaviors.