Improve handling of nested arrays and arrays of nullable values#4171
Open
hazefully wants to merge 6 commits into
Open
Improve handling of nested arrays and arrays of nullable values#4171hazefully wants to merge 6 commits into
hazefully wants to merge 6 commits into
Conversation
e19cb84 to
2e56331
Compare
2e56331 to
4010ce2
Compare
📊 Metrics Diff Analysis ReportSummary
ℹ️ About this analysisThis automated analysis compares query planner metrics between the base branch and this PR. It categorizes changes into:
The last category in particular may indicate planner regressions that should be investigated. New QueriesCount of new queries by file:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR improves handling of the user including nested arrays as a selected element, which is not possible due to the limitation of record-layer discussed in #4167, by rejecting the query at parsing time due to the lack of support for nested arrays. If the nested arrays are instead used to evaluate some other values (for example in a comparison), it is allowed as in https://github.com/hazefully/fdb-record-layer/blob/e19cb847765c7801d0d2e0d47ed0e0e374874d57/yaml-tests/src/test/resources/arrays-operators.yamsql#L259-L262.
The PR also improves handling of constructing arrays using underlying nullable values, by adding a promotion to the non-nullable variant of the same type, as arrays with non-nullable elements are also not supported. This used to cause issues in continuations, when attempting to parse the ResultSetMetadata that is serialised in the continuation. In addition, the array construction is migrated to make use of the
__internal_arraybuilt-in function since it now supports promoting record types properly while computing the max type of its elements.Finally, the PR contains an improvement to
fdb-relational-grpcto maintain the struct type names in the ResultSetMetadata to support asserting on these names in yaml-tests. The struct names were already maintained with embedded connections, so this makes the gRPC connection maintain the struct type names as well.