Skip to content
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

feat: Multiple docs with nil value on unique-indexed field #2276

Merged

Conversation

islamaliev
Copy link
Contributor

@islamaliev islamaliev commented Jan 31, 2024

Relevant issue(s)

Resolves #2180

Description

Allow multiple docs with nil value on unique-indexed field.
This change also included few minor query optimizations that involve secondary indexes.

Explain request is slightly adjusted not to increase field fetches count upon fetching indexes.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

Unit and integration tests.

Specify the platform(s) on which this was tested:

  • MacOS

@islamaliev islamaliev added area/query Related to the query component area/datastore Related to the datastore / storage engine system labels Jan 31, 2024
@islamaliev islamaliev added this to the DefraDB v0.10 milestone Jan 31, 2024
@islamaliev islamaliev self-assigned this Jan 31, 2024
@islamaliev islamaliev changed the title feat: Allow multiple docs with nil value on unique-indexed field feat: Multiple docs with nil value on unique-indexed field Jan 31, 2024
Copy link

codecov bot commented Jan 31, 2024

Codecov Report

Attention: 31 lines in your changes are missing coverage. Please review.

Comparison is base (cb08c18) 74.02% compared to head (a5fc174) 74.22%.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2276      +/-   ##
===========================================
+ Coverage    74.02%   74.22%   +0.20%     
===========================================
  Files          256      256              
  Lines        25740    25789      +49     
===========================================
+ Hits         19052    19141      +89     
+ Misses        5366     5333      -33     
+ Partials      1322     1315       -7     
Flag Coverage Δ
all-tests 74.22% <79.61%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
client/document.go 70.64% <100.00%> (+0.38%) ⬆️
db/fetcher/indexer.go 80.81% <100.00%> (+0.20%) ⬆️
db/fetcher/errors.go 36.36% <0.00%> (+16.36%) ⬆️
db/fetcher/indexer_iterators.go 79.39% <83.13%> (+1.11%) ⬆️
db/index.go 66.96% <72.73%> (+3.73%) ⬆️

... and 7 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cb08c18...a5fc174. Read the comment docs.

@islamaliev islamaliev requested a review from a team February 6, 2024 06:26
Copy link
Contributor

@AndrewSisley AndrewSisley left a comment

Choose a reason for hiding this comment

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

Looks good to me, I mostly just have documentation requests :)

db/fetcher/indexer_iterators.go Outdated Show resolved Hide resolved
tests/integration/index/create_unique_test.go Show resolved Hide resolved
db/fetcher/indexer_iterators.go Show resolved Hide resolved
db/fetcher/indexer_iterators.go Show resolved Hide resolved
db/index.go Show resolved Hide resolved
db/index.go Show resolved Hide resolved
db/index.go Outdated Show resolved Hide resolved
db/index.go Show resolved Hide resolved
db/index.go Show resolved Hide resolved
@islamaliev islamaliev merged commit 86b59c6 into sourcenetwork:develop Feb 7, 2024
31 of 32 checks passed
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
…work#2276)

## Relevant issue(s)

Resolves sourcenetwork#2180

## Description

Allow multiple docs with nil value on unique-indexed field.
This change also included few minor query optimizations that involve
secondary indexes.

Explain request is slightly adjusted not to increase field fetches count
upon fetching indexes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datastore Related to the datastore / storage engine system area/query Related to the query component
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sec. indexes: Allow multiple fields with nil values with unique index
3 participants