Skip to content
This repository was archived by the owner on Nov 7, 2025. It is now read-only.

Conversation

@avelanarius
Copy link
Member

When creating a table, Quesma uses both the schema information (which can come from "PUT /:index/_mapping" or YAML configuration) and the inferred types from JSON. However, the schema information does not contain knowledge whether a field is an array or not - in ElasticSearch essentially every field can become an array (a field with type "keyword" can receive an array of keywords).

Therefore Quesma has to handle arrays in a different way. Previously if it detected an array, it would not use schema information at all. This PR improves this logic - schema information is now combined with the JSON information (that a field is actually an array).

When creating a table, Quesma uses both the schema information
(which can come from "PUT /:index/_mapping" or YAML configuration)
and the inferred types from JSON. However, the schema information
does not contain knowledge whether a field is an array or not - in
ElasticSearch essentially every field can become an array (a field
with type "keyword" can receive an array of keywords).

Therefore Quesma has to handle arrays in a different way. Previously
if it detected an array, it would not use schema information at all.
This PR improves this logic - schema information is now combined
with the JSON information (that a field is actually an array).
@avelanarius
Copy link
Member Author

Still working on it - after fixing this bug, now another has appeared (validation of Array(Float64) field (based on mapping) does not allow passing it an Array(Int64) (from JSON)).

@avelanarius
Copy link
Member Author

Extracted a part of it to #1248

@pdelewski
Copy link
Contributor

Closing this due to conflicts and fork. Continuation in #1427

@pdelewski pdelewski closed this May 14, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 14, 2025
<!-- A note on testing your PR -->
<!-- Basic unit test run is executed against each commit in the PR.
If you want to run a full integration test suite, you can trigger it by
commenting
     with '/run-integration-tests' or '/run-it' -->

This is follow up to #976
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants