Skip to content

Commit

Permalink
Add support for LOWER function
Browse files Browse the repository at this point in the history
  • Loading branch information
philwitty committed Sep 10, 2021
1 parent e89b4aa commit 777d73d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions spanner/spannertest/funcs.go
Expand Up @@ -52,6 +52,14 @@ var functions = map[string]function{
return strings.HasPrefix(s, prefix), spansql.Type{Base: spansql.Bool}, nil
},
},
"LOWER": {
Eval: func(values []interface{}) (interface{}, spansql.Type, error) {
if len(values) != 1 {
return nil, spansql.Type{}, status.Error(codes.InvalidArgument, "No matching signature for function LOWER for the given argument types")
}
return strings.ToLower(values[0].(string)), spansql.Type{Base: spansql.String}, nil
},
},
}

type aggregateFunc struct {
Expand Down

0 comments on commit 777d73d

Please sign in to comment.