Skip to content

Commit 67e2498

Browse files
authored
Merge pull request #19 from rulego/dev
feat:字段访问支持访问数组
2 parents a05f4ac + 193e616 commit 67e2498

File tree

14 files changed

+2675
-762
lines changed

14 files changed

+2675
-762
lines changed

aggregator/group_aggregator.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
"sync"
88

99
"github.com/rulego/streamsql/functions"
10-
"github.com/rulego/streamsql/utils"
1110
"github.com/rulego/streamsql/utils/cast"
11+
"github.com/rulego/streamsql/utils/fieldpath"
1212
)
1313

1414
type Aggregator interface {
@@ -161,8 +161,8 @@ func (ga *GroupAggregator) Add(data interface{}) error {
161161
var found bool
162162

163163
// 检查是否是嵌套字段
164-
if utils.IsNestedField(field) {
165-
fieldVal, found = utils.GetNestedField(data, field)
164+
if fieldpath.IsNestedField(field) {
165+
fieldVal, found = fieldpath.GetNestedField(data, field)
166166
} else {
167167
// 原有的字段访问逻辑
168168
var f reflect.Value
@@ -240,8 +240,8 @@ func (ga *GroupAggregator) Add(data interface{}) error {
240240
var fieldVal interface{}
241241
var found bool
242242

243-
if utils.IsNestedField(inputField) {
244-
fieldVal, found = utils.GetNestedField(data, inputField)
243+
if fieldpath.IsNestedField(inputField) {
244+
fieldVal, found = fieldpath.GetNestedField(data, inputField)
245245
} else {
246246
// 原有的字段访问逻辑
247247
var f reflect.Value

0 commit comments

Comments
 (0)