Skip to content

Commit

Permalink
fix(func): merge_agg return nil if empty (lf-edge#2257)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiyong Huang <[email protected]>
  • Loading branch information
ngjaying committed Oct 9, 2023
1 parent 25fec97 commit 7830a82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion internal/binder/function/funcs_agg.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ func registerAggFunc() {
}
}
}
return result, true
if len(result) > 0 {
return result, true
}
}
return nil, true
},
Expand Down
6 changes: 3 additions & 3 deletions internal/binder/function/funcs_agg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ func TestConcatExec(t *testing.T) {
tests := []struct {
name string
args []interface{}
result map[string]interface{}
result any
}{
{ // 0
name: "concat wildcard",
Expand Down Expand Up @@ -312,13 +312,13 @@ func TestConcatExec(t *testing.T) {
int64(200),
},
},
result: map[string]interface{}{},
result: nil,
}, { // 2
name: "concat empty",
args: []interface{}{
[]interface{}{},
},
result: map[string]interface{}{},
result: nil,
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 7830a82

Please sign in to comment.