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: Add commits fieldName and fieldId fields #1451

Merged

Conversation

AndrewSisley
Copy link
Contributor

Relevant issue(s)

Resolves #851 #852

Description

Adds commits fieldName and fieldId fields, and allows grouping by them. Also fixes a bug in planner where errors in Init would result in unhelpful iterator not closed errors.

@AndrewSisley AndrewSisley added feature New feature or request area/query Related to the query component action/no-benchmark Skips the action that runs the benchmark. labels May 4, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.5.1 milestone May 4, 2023
@AndrewSisley AndrewSisley requested a review from a team May 4, 2023 16:21
@AndrewSisley AndrewSisley self-assigned this May 4, 2023
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #1451 (c8ab219) into develop (18221b9) will decrease coverage by 0.11%.
The diff coverage is 66.66%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1451      +/-   ##
===========================================
- Coverage    72.19%   72.08%   -0.11%     
===========================================
  Files          185      185              
  Lines        18166    18224      +58     
===========================================
+ Hits         13115    13137      +22     
- Misses        4017     4044      +27     
- Partials      1034     1043       +9     
Impacted Files Coverage Δ
db/collection_delete.go 31.28% <0.00%> (-0.72%) ⬇️
planner/errors.go 0.00% <ø> (ø)
db/collection_update.go 71.28% <25.00%> (-0.47%) ⬇️
planner/commit.go 78.08% <53.84%> (-3.65%) ⬇️
planner/planner.go 76.39% <62.50%> (-1.46%) ⬇️
client/descriptions.go 92.85% <85.71%> (-1.43%) ⬇️
core/crdt/composite.go 62.50% <100.00%> (+0.96%) ⬆️
core/crdt/lwwreg.go 76.00% <100.00%> (+0.74%) ⬆️
db/collection.go 68.79% <100.00%> (+0.12%) ⬆️
db/fetcher/versioned.go 57.75% <100.00%> (-1.39%) ⬇️
... and 4 more

... and 2 files with indirect coverage changes

@AndrewSisley AndrewSisley force-pushed the 852-commit-field-name branch 2 times, most recently from 89de210 to 13ff861 Compare May 4, 2023 17:11
planner/errors.go Show resolved Hide resolved
Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

LGTM!

It should never be missing, and is required for fieldId
Callers to this function do not, and really cannot be expected to close the returned planNode if an error is also returned.  This means that any errors yielded during the Init call will result in more errors later, for example on txn Discard, which fails with an iterator still open error - masking the original, underlying errror and making debugging much harder than it would otherwise be.

I also think it is misleading to have a public `MakePlan` function and have it call an also-public `Init` function and then have the consumer call a public `Start` function - they should either have to call all 3 themselves, or `Init` and `Start` should be private.
Test says it tests fetching the middle cid but only updates once and tests the last cid
Tests will fail in this commit due to cid changes, they will be fixed later alongside once other cid changes have been made.
Breaks the tests as cids have changed. Tests cids will be updated in a later commit alongside other test cids changes required by other commits.
@AndrewSisley AndrewSisley merged commit 1dcfcae into sourcenetwork:develop May 5, 2023
9 checks passed
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
## Relevant issue(s)

Resolves sourcenetwork#851  sourcenetwork#852

## Description

Adds commits fieldName and fieldId fields, and allows grouping by them.
Also fixes a bug in planner where errors in Init would result in
unhelpful iterator not closed errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/query Related to the query component feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Commits: Add field id field to commits fields
2 participants