Skip to content

Change default locale of date mappers to ENGLISH#112799

Merged
thecoop merged 14 commits intoelastic:mainfrom
thecoop:english-field-mappers
Oct 7, 2024
Merged

Change default locale of date mappers to ENGLISH#112799
thecoop merged 14 commits intoelastic:mainfrom
thecoop:english-field-mappers

Conversation

@thecoop
Copy link
Copy Markdown
Member

@thecoop thecoop commented Sep 12, 2024

This resolves #112744

Date processors are covered by #112796

@thecoop thecoop added >non-issue blocker :Search Foundations/Mapping Index mappings, including merging and defining field types v8.16.0 v9.0.0 labels Sep 12, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Sep 12, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@thecoop thecoop added >bug >breaking and removed >non-issue Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Sep 12, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Sep 12, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Hi @thecoop, I've created a changelog YAML for you. Note that since this PR is labelled >breaking, you need to update the changelog YAML to fill out the extended information sections.

@thecoop thecoop added the :StorageEngine/Data streams Data streams and their lifecycles label Sep 23, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Data Management (obsolete) DO NOT USE. This team no longer exists. label Sep 23, 2024
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

Pinging @elastic/es-data-management (Team:Data Management)

deserialized.getMetadata(),
instance.getBucketInnerInterval()
);
assertEqualInstances(instance, modified);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This test can no longer pass, as the locale of the formatter changes from root to english, and that can't be easily fixed up afterwards

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not familiar with this test but I would wonder if we need a replacement of some sort for it. This is a question for the @elastic/es-analytical-engine I think . cc @nik9000

@thecoop thecoop requested a review from a team as a code owner September 24, 2024 09:51
@thecoop thecoop removed the blocker label Sep 24, 2024
@thecoop
Copy link
Copy Markdown
Member Author

thecoop commented Sep 24, 2024

@elasticmachine update branch

Copy link
Copy Markdown
Contributor

@javanna javanna left a comment

Choose a reason for hiding this comment

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

I pinged a couple of folks to check some specific aspects of this change. I think my only question is whether we have proper rolling upgrade tests that cover for this change, to make sure that the change in default value is applied and works properly. Not sure if you have given this some thought already.

deserialized.getMetadata(),
instance.getBucketInnerInterval()
);
assertEqualInstances(instance, modified);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I am not familiar with this test but I would wonder if we need a replacement of some sort for it. This is a question for the @elastic/es-analytical-engine I think . cc @nik9000

configuredSettings.remove("type");
configuredSettings.remove("meta");
configuredSettings.remove("format");
configuredSettings.remove("locale");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@martijnvg do you know the answer to this question? Are you ok with this change?

@thecoop
Copy link
Copy Markdown
Member Author

thecoop commented Sep 27, 2024

I think my only question is whether we have proper rolling upgrade tests that cover for this change, to make sure that the change in default value is applied and works properly.

I don't think we need to do anything specific here, as the default locale is not persisted in a 'canonical' definition, so it'll just use whatever the specified parameter default is

@thecoop thecoop requested review from martijnvg and nik9000 October 2, 2024 10:19
@thecoop thecoop added the auto-backport Automatically create backport pull requests when merged label Oct 2, 2024
Copy link
Copy Markdown
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.

The org.elasticsearch.index.mapper package side LGTM.

@thecoop thecoop force-pushed the english-field-mappers branch from e0a2896 to 460576b Compare October 4, 2024 09:29
String zoneId = in.readString();
this.timeZone = ZoneId.of(zoneId);
this.formatter = DateFormatter.forPattern(formatterPattern).withZone(this.timeZone);
this.formatter = DateFormatter.forPattern(formatterPattern).withZone(this.timeZone).withLocale(locale);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we set this to DEFAULT_LOCALE rather than serialize it? It looks like you can't change it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It is read from the specified DateTimeFormatter, which can be changed by eg the new locale option on RangeFieldMapper

@thecoop thecoop merged commit 4ef5ea6 into elastic:main Oct 7, 2024
@thecoop thecoop deleted the english-field-mappers branch October 7, 2024 09:22
@elasticsearchmachine
Copy link
Copy Markdown
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 112799

thecoop added a commit to thecoop/elasticsearch that referenced this pull request Oct 7, 2024
English is not changing between COMPAT and CLDR locale databases, whereas ROOT is
thecoop added a commit that referenced this pull request Oct 7, 2024
matthewabbott pushed a commit to matthewabbott/elasticsearch that referenced this pull request Oct 10, 2024
English is not changing between COMPAT and CLDR locale databases, whereas ROOT is
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 >non-issue :Search Foundations/Mapping Index mappings, including merging and defining field types :StorageEngine/Data streams Data streams and their lifecycles Team:Data Management (obsolete) DO NOT USE. This team no longer exists. Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch test-update-serverless v8.16.0 v9.0.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default locale of date mappers and range queries to english

8 participants