File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,7 @@ func (p *PartitionManager) updatePartitionInSchema(partition *DBPartition) error
196
196
func (p * PartitionManager ) PartsForRange (mint , maxt int64 ) []* DBPartition {
197
197
var parts []* DBPartition
198
198
for _ , part := range p .partitions {
199
- if part .startTime >= mint && (maxt == 0 || part .startTime < maxt ) {
199
+ if part .InRange ( mint ) || part . InRange (maxt ) || ( mint < part .GetStartTime () && maxt > part . GetEndTime () ) {
200
200
parts = append (parts , part )
201
201
}
202
202
}
@@ -311,7 +311,7 @@ func (p *DBPartition) TimeToChunkId(tmilli int64) (int, error) {
311
311
if tmilli >= p .startTime && tmilli <= p .GetEndTime () {
312
312
return int ((tmilli - p .startTime )/ p .chunkInterval ) + 1 , nil
313
313
} else {
314
- return 0 , errors .New ("time " + string ( tmilli ) + " is not covered by time partition" )
314
+ return - 1 , errors .Errorf ("time %d is not covered by time partition" , tmilli )
315
315
}
316
316
}
317
317
@@ -320,7 +320,7 @@ func (p *DBPartition) InRange(t int64) bool {
320
320
if p .manager .cyclic {
321
321
return true
322
322
}
323
- return t >= p .startTime && t < p .GetEndTime ()
323
+ return t >= p .startTime && t <= p .GetEndTime ()
324
324
}
325
325
326
326
// return the mint and maxt for this partition, may need maxt for cyclic partition
You can’t perform that action at this time.
0 commit comments