Skip to content

Commit

Permalink
Fix object field access for fields that have periods in them. I.e. ob…
Browse files Browse the repository at this point in the history
…ject->`my.field`
  • Loading branch information
cube2222 committed Aug 17, 2022
1 parent e19d068 commit d0f502e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -747,11 +747,7 @@ func ParseExpression(expr sqlparser.Expr) (logical.Expression, error) {
if err != nil {
return nil, errors.Wrap(err, "couldn't parse object")
}
parts := strings.Split(expr.Field.String(), ".")
out := arg
for i := range parts {
out = logical.NewObjectFieldAccess(out, parts[i])
}
out := logical.NewObjectFieldAccess(arg, expr.Field.String())
return out, nil
default:
return nil, errors.Errorf("unsupported expression %+v of type %v", expr, reflect.TypeOf(expr))
Expand Down

0 comments on commit d0f502e

Please sign in to comment.