-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Support non-keyword dimensions as routing fields in TSDB #105501
Conversation
# Conflicts: # server/src/test/java/org/elasticsearch/index/mapper/RootObjectMapperTests.java
# Conflicts: # modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml
This is getting pretty long, I'm forking the |
# Conflicts: # modules/lang-painless/src/main/java/org/elasticsearch/painless/action/PainlessExecuteAction.java # server/src/main/java/org/elasticsearch/cluster/routing/IndexRouting.java # server/src/main/java/org/elasticsearch/index/IndexMode.java # server/src/main/java/org/elasticsearch/index/mapper/RoutingFieldMapper.java # server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java # server/src/main/java/org/elasticsearch/index/mapper/TsidExtractingIdFieldMapper.java # server/src/test/java/org/elasticsearch/index/mapper/TimeSeriesIdFieldMapperTests.java # server/src/test/java/org/elasticsearch/indices/recovery/RecoverySourceHandlerTests.java
The forked PR is in, back to this. Changes are now limited to mappings, mostly. |
Pinging @elastic/es-search (Team:Search) |
...ms/src/internalClusterTest/java/org/elasticsearch/datastreams/TSDBPassthroughIndexingIT.java
Show resolved
Hide resolved
modules/data-streams/src/yamlRestTest/resources/rest-api-spec/test/data_stream/150_tsdb.yml
Show resolved
Hide resolved
super(name); | ||
} | ||
|
||
void setDimension() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename this method to enableDimension()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm that would be misleading, we want to mark that the mapper to be built will actually be a dimension, not that the builder is enabled to build a dimension (it is, de factor).
I really don't like the name though. This class creates objects that can build dimension fields but will not necessarily do. Any suggestions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if we can move Parameter<Boolean> dimension
into this builder, but that looks like a bigger refactoring to me.
So passthrough field mapper invokes setDimension()
here and then other field mappers (keyword, number, etc.) can become dimensions. Maybe this method should be called inheritDimension()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, switched to inheritDimensionParameterFromParentObject
, more verbose for sure.
server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/mapper/MappedFieldType.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is a follow-up on #103648, lifting the limitation that the pass-through object can contain only keyword fields if it's marked as time_series_dimension. In particular, fields included in the routing path no more need to be keywords.
#106080 included all required changes around routing. This change builds on top of it, including changes in mappings. In particular, it streamlines mapping eligibility as dimension fields.
Related to #103567