Skip to content

ESQL - transport version change to support TSDB metadata #129649

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

Merged
merged 8 commits into from
Jul 2, 2025

Conversation

not-napoleon
Copy link
Member

Relates to #128621

This is a first step in making the ES|QL query planner aware of TSDB Dimensions and Metric field metadata. This is purposefully small to only touch the serialization change we'll need for this. The plan is get the TSDB metadata field type out of Field Caps and to store this information on EsField. This PR adds a place to store such a field, and adds it to the serialization for EsField and its sub-classes.

As of this PR, we don't do anything with this data. That's intentional, to minimize the footprint of the transport version change. Further PRs in this project will load and act on this data. I've added some constructors here to minimize the number of files I'm touching in this PR. I hope that as we begin loading this data (as opposed to just defaulting it right now) we can get rid of some of these default value constructors.

Copy link
Contributor

🔍 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.

 Conflicts:
	docs/reference/query-languages/esql/kibana/definition/functions/knn.json
	docs/reference/query-languages/esql/kibana/docs/functions/knn.md
	server/src/main/java/org/elasticsearch/TransportVersions.java
Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

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

The changes look good to me. Just curious - how do we plan to handle conflicts in metadata types between indices? Thanks Mark!

@@ -214,10 +216,11 @@ private static EsField fieldWithRecursiveChildren(int depth, int childrenPerLeve
* A single root with 9 children, each of which has 9 children etc. 6 levels deep.
*/
public void testDeeplyNestedFields() throws IOException {
ByteSizeValue expectedSize = ByteSizeValue.ofBytes(9425494);
ByteSizeValue expectedSize = ByteSizeValue.ofBytes(10023365);
Copy link
Member

Choose a reason for hiding this comment

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

There will be a small overhead for use cases with many fields, but I think this should be fine.

@not-napoleon not-napoleon marked this pull request as ready for review July 2, 2025 16:31
@elasticsearchmachine elasticsearchmachine added Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine labels Jul 2, 2025
@elasticsearchmachine
Copy link
Collaborator

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

@elasticsearchmachine
Copy link
Collaborator

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

@not-napoleon not-napoleon merged commit a7a79f7 into elastic:main Jul 2, 2025
32 checks passed
@not-napoleon
Copy link
Member Author

Just curious - how do we plan to handle conflicts in metadata types between indices?

I think it's going to depend on the specific conflict. If a field is mapped as a dimension in one index and a metric in another, that seems like it has to be an error. I don't see a sensible way to proceed with that query. Going from no metadata type to dimension should just promote to dimension (that's the "label" use case). No metadata to metric I'm not sure about. I can't think of a case where that's not an error, but I'm not sure there isn't one.

At any rate, we should probably have more discussion about this as we are building this feature. The conflict case is non-trivial.

@kkrik-es
Copy link
Contributor

kkrik-es commented Jul 2, 2025

No metadata to metric I'm not sure about. I can't think of a case where that's not an error, but I'm not sure there isn't one.

I've seen metrics that are not marked as such, but they're simple long values for instance. We should probably do the same as dimensions, i.e. treat them all as metrics.

not-napoleon added a commit that referenced this pull request Jul 2, 2025
#129649 introduced a duplicate transport version. This fixes it.
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
)

Relates to elastic#128621

This is a first step in making the ES|QL query planner aware of TSDB Dimensions and Metric field metadata. This is purposefully small to only touch the serialization change we'll need for this. The plan is get the TSDB metadata field type out of Field Caps and to store this information on EsField. This PR adds a place to store such a field, and adds it to the serialization for EsField and its sub-classes.

As of this PR, we don't do anything with this data. That's intentional, to minimize the footprint of the transport version change. Further PRs in this project will load and act on this data. I've added some constructors here to minimize the number of files I'm touching in this PR. I hope that as we begin loading this data (as opposed to just defaulting it right now) we can get rid of some of these default value constructors.
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
elastic#129649 introduced a duplicate transport version. This fixes it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Analytics/ES|QL AKA ESQL >non-issue :StorageEngine/TSDB You know, for Metrics Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) Team:StorageEngine v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants