mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
fix int64 attr
This commit is contained in:
parent
4394a97db8
commit
b68c1caea0
3 changed files with 9 additions and 3 deletions
8
attr.go
8
attr.go
|
|
@ -108,8 +108,14 @@ func (s *AttrStore) SetAttrs(id uint64, m map[string]interface{}) error {
|
|||
for k, v := range m {
|
||||
if v == nil {
|
||||
delete(attr, k)
|
||||
} else {
|
||||
continue
|
||||
}
|
||||
|
||||
switch v := v.(type) {
|
||||
case string, uint64, bool:
|
||||
attr[k] = v
|
||||
default:
|
||||
return fmt.Errorf("invalid attr type: %T", v)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ message Profile {
|
|||
message Attr {
|
||||
required string Key = 1;
|
||||
optional string StringValue = 2;
|
||||
optional uint64 UintValue = 3;
|
||||
optional uint64 UintValue = 3;
|
||||
optional bool BoolValue = 4;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -390,7 +390,7 @@ func (p *Parser) parseSetBitmapAttrsCall() (*SetBitmapAttrs, error) {
|
|||
case string, bool:
|
||||
c.Attrs[key] = v
|
||||
case uint64:
|
||||
c.Attrs[key] = int64(v)
|
||||
c.Attrs[key] = v
|
||||
default:
|
||||
return nil, parseErrorf(pos, "invalid SetBitmapAttrs() arg: %v", arg.key)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue