Skip to content

Conversation

@luigidellaquila
Copy link
Contributor

Adding tests and fixing docs for usage of date math in index patterns, especially in LOOKUP JOIN, that got recent support for aliases.

@luigidellaquila luigidellaquila added >docs General docs changes >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL labels Jul 3, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

🔍 Preview links for changed docs:

🔔 The preview site may take up to 3 minutes to finish building. These links will become live once it completes.

@elasticsearchmachine elasticsearchmachine added Team:Docs Meta label for docs team Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) v9.2.0 labels Jul 3, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@github-actions
Copy link
Contributor

github-actions bot commented Jul 3, 2025

🔍 Preview links for changed docs

Copy link
Contributor

@alex-spies alex-spies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks Luigi!

Our docs now mention that wildcards also work as long as they resolve to a single lookup index. Do we have a test for this?

}

public void testDateMathIndexPattern() throws IOException {
ZonedDateTime now = ZonedDateTime.now(ZoneOffset.UTC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using now may lead to flakiness when the tests are executed around midnight, no? Maybe a fixed date would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, but date math is all about dynamic patterns using now. I'm not sure a test with a fixed date will be realistic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing I can do is to use the year only, that should drastically reduce the risk of flakiness

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How long does this test runs?
I have seen some sql/eql examples that add assumption they are executed at least 10-15 minutes before midnight.

@luigidellaquila
Copy link
Contributor Author

Our docs now mention that wildcards also work as long as they resolve to a single lookup inde

@alex-spies yes, we have tests, but I completely misread them. We explicitly disallow the usage of *. Let me fix the doc

@luigidellaquila luigidellaquila enabled auto-merge (squash) July 3, 2025 10:08
@luigidellaquila luigidellaquila added auto-backport Automatically create backport pull requests when merged v9.1.0 labels Jul 3, 2025
request.addParameter("refresh", "true");
request.setJsonEntity("{\"f\":" + idx++ + "}");
assertOK(client().performRequest(request));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this might need a refresh.
I wonder if we have anything similar to indexRandom for the RestTestCases?

@luigidellaquila luigidellaquila merged commit 912a86d into elastic:main Jul 3, 2025
32 checks passed
luigidellaquila added a commit to luigidellaquila/elasticsearch that referenced this pull request Jul 3, 2025
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged >docs General docs changes Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:Docs Meta label for docs team >test Issues or PRs that are addressing/adding tests v9.1.0 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants