Skip to content

[ES|QL] Append the casting only when necessary in Discover filtering#234748

Merged
stratoula merged 4 commits intoelastic:mainfrom
stratoula:update-casting
Sep 15, 2025
Merged

[ES|QL] Append the casting only when necessary in Discover filtering#234748
stratoula merged 4 commits intoelastic:mainfrom
stratoula:update-casting

Conversation

@stratoula
Copy link
Contributor

@stratoula stratoula commented Sep 11, 2025

Summary

We are casting things we don't need to. This is checking the list. The problem with casting is that it is very slow. This is why we prefer to not cast when possible

Checklist

@stratoula stratoula added Feature:ES|QL ES|QL related features in Kibana Team:ESQL ES|QL related features in Kibana t// release_note:enhancement labels Sep 11, 2025
@stratoula stratoula changed the title [ES|QL] Append the casting only when necessary Sep 11, 2025
@stratoula stratoula added v9.2.0 backport:skip This PR does not require backporting labels Sep 11, 2025
@stratoula stratoula marked this pull request as ready for review September 11, 2025 15:04
@stratoula stratoula requested a review from a team as a code owner September 11, 2025 15:04
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-esql (Team:ESQL)

fieldType !== 'string' &&
fieldType !== 'number' &&
(fieldType === undefined ||
!PARAM_TYPES_THAT_SUPPORT_IMPLICIT_STRING_CASTING.includes(
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this work?

I meant PARAM_TYPES_THAT_SUPPORT_IMPLICIT_STRING_CASTING to denote types that could be implicitly casted from strings, but it seems like here it is being interpreted the opposite way. 🤔

Copy link
Contributor Author

@stratoula stratoula Sep 15, 2025

Choose a reason for hiding this comment

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

Yes it does. I think this variable name is wrong because these fields can be used without casting to string. OR they needed implicit casting but now they dont. I asked ES and I tested them.

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 saved them in another variable to help with the confusion but it would be good to test where you are using the other variable and if you need to do changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I built this list for my use case. Glad it works for this one, too!

@elasticmachine
Copy link
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Jest Tests #2 / should render status information
  • [job] [logs] FTR Configs #71 / discover/group3 discover request counts ES|QL mode should send expected requests for saved search changes
  • [job] [logs] FTR Configs #60 / discover/security/context_awareness cell renderer ES|QL mode should render alert workflow status badge

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
data 37.9KB 38.0KB +57.0B
discover 1.1MB 1.1MB +57.0B
total +114.0B

History

@stratoula stratoula merged commit d129537 into elastic:main Sep 15, 2025
12 checks passed
CAWilson94 pushed a commit to CAWilson94/kibana that referenced this pull request Sep 24, 2025
…lastic#234748)

## Summary

We are casting things we don't need to. This is checking the list. The
problem with casting is that it is very slow. This is why we prefer to
not cast when possible

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
niros1 pushed a commit that referenced this pull request Sep 30, 2025
…234748)

## Summary

We are casting things we don't need to. This is checking the list. The
problem with casting is that it is very slow. This is why we prefer to
not cast when possible

### Checklist

- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting Feature:ES|QL ES|QL related features in Kibana release_note:enhancement Team:ESQL ES|QL related features in Kibana t// v9.2.0

3 participants