Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nik9000
Copy link
Member

@nik9000 nik9000 commented Mar 3, 2025

Most functions turn multivalue fields into null, but a few "obvious" ones do the "obvious" things. This starts to document these behaviors.

Most functions turn multivalue fields into `null`, but a few "obvious"
ones do the "obvious" things. This starts to document these behaviors.
@nik9000 nik9000 added >docs General docs changes :Analytics/ES|QL AKA ESQL v9.0.0 v9.1.0 labels Mar 3, 2025
@elasticsearchmachine elasticsearchmachine added Team:Docs Meta label for docs team Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) labels Mar 3, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-docs (Team:Docs)

@elasticsearchmachine
Copy link
Collaborator

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.
Copy link
Member Author

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.

Copy link
Member Author

@nik9000 nik9000 left a 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.

We need to decide something important before mering.
@@ -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
Copy link
Contributor

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"), }
Copy link
Contributor

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team v9.0.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants