mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-12 15:51:01 +00:00
added default granulatrity to time fragments'
This commit is contained in:
parent
bfd50e219d
commit
3be3c1f4c5
1 changed files with 12 additions and 1 deletions
13
core/http.go
13
core/http.go
|
|
@ -346,13 +346,24 @@ func bitmaps(frame string, obj JsonObject) chan uint64 {
|
|||
if timestamp == "2014-01-01 00:00:00" { //skip the default timestamp
|
||||
c <- base_id
|
||||
} else {
|
||||
quantum := index.YMDH
|
||||
if val, ok := obj["time_granulatrity"]; ok {
|
||||
switch val {
|
||||
case "Y":
|
||||
quantum = index.Y
|
||||
case "M":
|
||||
quantum = index.YM
|
||||
case "D":
|
||||
quantum = index.YMD
|
||||
}
|
||||
}
|
||||
shortForm := shortFormS
|
||||
if strings.Contains(timestamp, "T") {
|
||||
shortForm = shortFormT
|
||||
}
|
||||
atime, _ := time.Parse(shortForm, timestamp)
|
||||
|
||||
for _, id := range index.GetTimeIds(base_id, atime, index.YMDH) {
|
||||
for _, id := range index.GetTimeIds(base_id, atime, quantum) {
|
||||
c <- id
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue