Skip to content

Commit

Permalink
Fixing bug in edge listing core processor
Browse files Browse the repository at this point in the history
  • Loading branch information
kellrott committed Nov 20, 2019
1 parent 11e3131 commit cfc95c3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion engine/core/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func StatementProcessor(gs *gripql.GraphStatement, db gdbi.GraphInterface, ps *g
}
ids := protoutil.AsStringList(stmt.E)
ps.LastType = gdbi.EdgeData
return &LookupEdges{db: db, ids: ids}, nil
return &LookupEdges{db: db, ids: ids, loadData: ps.StepLoadData()}, nil

case *gripql.GraphStatement_In, *gripql.GraphStatement_InV:
labels := append(protoutil.AsStringList(gs.GetIn()), protoutil.AsStringList(gs.GetInV())...)
Expand Down
7 changes: 4 additions & 3 deletions engine/inspect/inspect.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,10 @@ func PipelineStepOutputs(stmts []*gripql.GraphStatement) map[string][]string {
out[a] = []string{"*"}
}
}
case *gripql.GraphStatement_V, *gripql.GraphStatement_Out, *gripql.GraphStatement_In,
*gripql.GraphStatement_OutE, *gripql.GraphStatement_InE, *gripql.GraphStatement_Both,
*gripql.GraphStatement_BothE:
case *gripql.GraphStatement_V, *gripql.GraphStatement_E,
*gripql.GraphStatement_Out, *gripql.GraphStatement_In,
*gripql.GraphStatement_OutE, *gripql.GraphStatement_InE,
*gripql.GraphStatement_Both, *gripql.GraphStatement_BothE:
out[steps[i]] = []string{"*"}
onLast = false
case *gripql.GraphStatement_LookupVertsIndex:
Expand Down
8 changes: 8 additions & 0 deletions engine/inspect/test/inspect_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ func TestOutputMasking(t *testing.T) {
t.Errorf("Incorrect output")
}

q = gripql.NewQuery()
q = q.E()
out = inspect.PipelineStepOutputs(q.Statements)
fmt.Printf("EdgeList vars: %s\n", out)
if len(out) != 1 {
t.Errorf("Wrong number of step outputs %d", len(out))
}

q = gripql.NewQuery()
q = q.V().Out().In().Count()
out = inspect.PipelineStepOutputs(q.Statements)
Expand Down

0 comments on commit cfc95c3

Please sign in to comment.