Skip to content

Commit

Permalink
PR FIXUP - Fix mapper commit prop name
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewSisley committed May 8, 2023
1 parent 9410098 commit 47ae50e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
14 changes: 7 additions & 7 deletions planner/commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,16 @@ func (n *dagScanNode) Init() error {
if n.commitSelect.DocKey.HasValue() {
key := core.DataStoreKey{}.WithDocKey(n.commitSelect.DocKey.Value())

if n.commitSelect.FieldIDName.HasValue() {
field := n.commitSelect.FieldIDName.Value()
if n.commitSelect.FieldID.HasValue() {
field := n.commitSelect.FieldID.Value()
key = key.WithFieldId(field)
}

n.spans = core.NewSpans(core.NewSpan(key, key.PrefixEnd()))
}
}

return n.fetcher.Start(n.planner.ctx, n.planner.txn, n.spans, n.commitSelect.FieldIDName)
return n.fetcher.Start(n.planner.ctx, n.planner.txn, n.spans, n.commitSelect.FieldID)
}

func (n *dagScanNode) Start() error {
Expand All @@ -105,8 +105,8 @@ func (n *dagScanNode) Spans(spans core.Spans) {
copy(headSetSpans.Value, spans.Value)

var fieldId string
if n.commitSelect.FieldIDName.HasValue() {
fieldId = n.commitSelect.FieldIDName.Value()
if n.commitSelect.FieldID.HasValue() {
fieldId = n.commitSelect.FieldID.Value()
} else {
fieldId = core.COMPOSITE_NAMESPACE
}
Expand All @@ -130,8 +130,8 @@ func (n *dagScanNode) simpleExplain() (map[string]any, error) {
simpleExplainMap := map[string]any{}

// Add the field attribute to the explanation if it exists.
if n.commitSelect.FieldIDName.HasValue() {
simpleExplainMap[request.FieldIDName] = n.commitSelect.FieldIDName.Value()
if n.commitSelect.FieldID.HasValue() {
simpleExplainMap[request.FieldIDName] = n.commitSelect.FieldID.Value()
} else {
simpleExplainMap[request.FieldIDName] = nil
}
Expand Down
10 changes: 5 additions & 5 deletions planner/mapper/commitSelect.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type CommitSelect struct {
DocKey immutable.Option[string]

// The field for which commits have been requested.
FieldIDName immutable.Option[string]
FieldID immutable.Option[string]

// The maximum depth to yield results for.
Depth immutable.Option[uint64]
Expand All @@ -41,9 +41,9 @@ func (s *CommitSelect) CloneTo(index int) Requestable {

func (s *CommitSelect) cloneTo(index int) *CommitSelect {
return &CommitSelect{
Select: *s.Select.cloneTo(index),
DocKey: s.DocKey,
FieldIDName: s.FieldIDName,
Cid: s.Cid,
Select: *s.Select.cloneTo(index),
DocKey: s.DocKey,
FieldID: s.FieldID,
Cid: s.Cid,
}
}
10 changes: 5 additions & 5 deletions planner/mapper/mapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,11 +831,11 @@ func ToCommitSelect(
return nil, err
}
return &CommitSelect{
Select: *underlyingSelect,
DocKey: selectRequest.DocKey,
FieldIDName: selectRequest.FieldID,
Depth: selectRequest.Depth,
Cid: selectRequest.Cid,
Select: *underlyingSelect,
DocKey: selectRequest.DocKey,
FieldID: selectRequest.FieldID,
Depth: selectRequest.Depth,
Cid: selectRequest.Cid,
}, nil
}

Expand Down

0 comments on commit 47ae50e

Please sign in to comment.