Skip to content

Commit

Permalink
Fix AS keyword bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdusovic committed Jun 7, 2016
1 parent baa6da5 commit 61608dd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bql/planner/planner.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,14 @@ func (p *queryPlan) processGraphPattern(ctx context.Context, lo *storage.LookupO
// groups it by if needed.
func (p *queryPlan) projectAndGroupBy() error {
grp := p.stm.GroupByBindings()
if len(grp) == 0 {
// The table only needs to be projected.
if len(grp) == 0 { // The table only needs to be projected.
p.tbl.AddBindings(p.stm.OutputBindings())
// For each row, copy each input binding value to its appropriate alias.
for _, prj := range p.stm.Projections() {
for _, row := range p.tbl.Rows() {
row[prj.Alias] = row[prj.Binding]
}
}
return p.tbl.ProjectBindings(p.stm.OutputBindings())
}
// The table needs to be group reduced.
Expand Down

0 comments on commit 61608dd

Please sign in to comment.