mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
This commit adds a Decimal field type which is implemented mostly with the Int field. It adds an optional "Scale" value to the Int field which means that the values stored in that field are actually meant to be divided by 10^Scale before being interpreted. In order to make use of this functionality, we extend the importValue request to allow a slice of floats rather than just int64. If the slice of floats is present, each float in the slice is multiplied by 10^Scale and converted to an int64 before being imported. If a slice of int64 is imported to a Decimal field, it is treated normally, and scale is ignored. This allows the conversion to be handled at the client side if desired. Currently there are Field level methods for querying Float values out of a decimal field, but no support in PQL or the executor for getting float values. Going to wait until I can use the generic result type before doing that, so for now, any values queried will be the scaled integer values. needed to add client support for importing float values, and did this by adding a more general and simplified client method for value imports. rewrote api.ImportValue to use the new method which should be more performant and efficient. allow floats to be "pilosa import"ed into decimal fields |
||
|---|---|---|
| .. | ||
| pilosa | ||
| check.go | ||
| check_test.go | ||
| config.go | ||
| doc.go | ||
| export.go | ||
| export_test.go | ||
| generate_config.go | ||
| import.go | ||
| import_test.go | ||
| inspect.go | ||
| inspect_test.go | ||
| root.go | ||
| root_test.go | ||
| server.go | ||
| server_test.go | ||