Skip to content

Conversation

@lkts
Copy link
Contributor

@lkts lkts commented Apr 10, 2025

This PR adds usage of FallbackSyntheticSourceBlockLoader to ip field. It also adds logic to load from a stored field and stored source since it was missing.

@lkts lkts added >enhancement auto-backport Automatically create backport pull requests when merged :StorageEngine/Mapping The storage related side of mappings v8.19.0 labels Apr 10, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

@elasticsearchmachine
Copy link
Collaborator

Hi @lkts, I've created a changelog YAML for you.

}
return null;

if (isStored()) {
Copy link
Contributor Author

@lkts lkts Apr 10, 2025

Choose a reason for hiding this comment

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

I added this because it was very easy to do. I am not sure if there are any cases when this is not beneficial? Some existing implementations don't bother and just go straight to loading from source.

Copy link
Member

Choose a reason for hiding this comment

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

👍 - seems easy to just do in this pr.


@Override
public BlockLoader blockLoader(BlockLoaderContext blContext) {
if (hasDocValues()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should i check for FieldExtractPreference.DOC_VALUES here?

Copy link
Member

Choose a reason for hiding this comment

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

No, I don't think we have to. This only seems to be used in geo based field types.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, sorry, i actually meant FieldExtractPreference.STORED.

Copy link
Member

Choose a reason for hiding this comment

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

it would be nice to check, yes.

Copy link
Member

Choose a reason for hiding this comment

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

For context - that's the user asking you to load from _source. If you ignore it you are ignoring their kind request. You are sure allowed, but you probably shouldn't ignore it.

Copy link
Member

@martijnvg martijnvg left a comment

Choose a reason for hiding this comment

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

LGTM 👍


@Override
public BlockLoader blockLoader(BlockLoaderContext blContext) {
if (hasDocValues()) {
Copy link
Member

Choose a reason for hiding this comment

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

No, I don't think we have to. This only seems to be used in geo based field types.

}
return null;

if (isStored()) {
Copy link
Member

Choose a reason for hiding this comment

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

👍 - seems easy to just do in this pr.

@lkts lkts merged commit 9d18d52 into elastic:main Apr 11, 2025
17 checks passed
@lkts lkts deleted the synthetic_source_block_loader_ip branch April 11, 2025 20:37
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 126644

@lkts
Copy link
Contributor Author

lkts commented Apr 11, 2025

💚 All backports created successfully

Status Branch Result
8.x

Questions ?

Please refer to the Backport tool documentation

lkts added a commit that referenced this pull request Apr 11, 2025
…6644) (#126727)

* Add block loader from stored field and source for ip field (#126644)

(cherry picked from commit 9d18d52)

# Conflicts:
#	x-pack/plugin/build.gradle
#	x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlCapabilities.java

* fix
@nik9000
Copy link
Member

nik9000 commented Jun 26, 2025

@lkts is this one still backport_pending?

@nik9000
Copy link
Member

nik9000 commented Jun 26, 2025

This is merged to 8.19.

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

Labels

auto-backport Automatically create backport pull requests when merged >enhancement :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants