Skip to content

Conversation

@lkts
Copy link
Contributor

@lkts lkts commented Feb 6, 2025

This PR adds generation of null_value and ignore_malformed (including malformed values generation) mapping parameters to fields that support them (number fields). This is done in preparation to work on a fallback synthetic source block loader for number fields since the test infra is shared.

@lkts lkts added >test Issues or PRs that are addressing/adding tests auto-backport Automatically create backport pull requests when merged :StorageEngine/Mapping The storage related side of mappings v8.19.0 labels Feb 6, 2025
@elasticsearchmachine
Copy link
Collaborator

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

}

private static boolean matchCountsEqualExact(List<String> actualNormalized, List<String> expectedNormalized) {
HashMap<String, Integer> counts = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: let's use TreeMap for maps, it helps with debugging..

}
}

return counts.isEmpty();
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't we want to return something about the delta? Maybe return a string for counts, or null?

* @return
*/
static Supplier<Object> defaults(Supplier<Object> rawValues, DataSource dataSource) {
var nulls = dataSource.get(new DataSourceRequest.NullWrapper());
Copy link
Contributor

Choose a reason for hiding this comment

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

I think I missed the null value inject, do we have existing logic that randomly injects nulls, or the null_value if one is provided?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We do.

Copy link
Contributor

@kkrik-es kkrik-es left a comment

Choose a reason for hiding this comment

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

Looks painful.

@lkts lkts merged commit d52be5f into elastic:main Feb 7, 2025
17 checks passed
@lkts lkts deleted the synthetic_source_block_loader_numbers branch February 7, 2025 19:59
@elasticsearchmachine
Copy link
Collaborator

💚 Backport successful

Status Branch Result
8.x

elasticsearchmachine pushed a commit that referenced this pull request Feb 7, 2025
…121983) (#122091)

* Add ignore_malformed and null_values to test data generation (#121983)

* fix compilation
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 :StorageEngine/Mapping The storage related side of mappings Team:StorageEngine >test Issues or PRs that are addressing/adding tests v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants