-
Notifications
You must be signed in to change notification settings - Fork 23
Broken import with Pilosa repo master #202
Comments
That PR was merged, which should fix this problem. |
Sweet! looked like something being not merged, thanks for quick reaction, see roaring imports going through. standard_4849657524411 standard_4849660268705 standard_4849663016106 |
We support roaring import for time fields now, so the views are computed at the client side and sent to the server. Those view names are not normal though, they should be like: |
I am able to reproduce this issue if I overflow a timestamp, like: package main
import (
"io"
"log"
pilosa "github.com/pilosa/go-pilosa"
)
func main() {
cl := pilosa.DefaultClient()
schema, err := cl.Schema()
if err != nil {
log.Fatal(err)
}
ix := schema.Index("ix")
fx := ix.Field("fx", pilosa.OptFieldTypeTime(pilosa.TimeQuantumMonthDay))
err = cl.SyncSchema(schema)
if err != nil {
log.Fatal(err)
}
err = cl.ImportField(fx, newTestIteratorWithTimestamp())
if err != nil {
log.Fatal(err)
}
}
type ArrayRecordIterator struct {
records []pilosa.Record
nextIndex int
}
func NewArrayRecordIterator(records []pilosa.Record) *ArrayRecordIterator {
return &ArrayRecordIterator{
records: records,
}
}
func (ar *ArrayRecordIterator) NextRecord() (pilosa.Record, error) {
if ar.nextIndex >= len(ar.records) {
return nil, io.EOF
}
rec := ar.records[ar.nextIndex]
ar.nextIndex += 1
return rec, nil
}
func newTestIteratorWithTimestamp() *ArrayRecordIterator {
x := uint64(1 << 63)
return NewArrayRecordIterator([]pilosa.Record{
pilosa.Column{RowID: 10, ColumnID: 7, Timestamp: int64(x)}, // overflow
pilosa.Column{RowID: 10, ColumnID: 5, Timestamp: 1483273800}, // 2017-01-01 12:30:00
pilosa.Column{RowID: 2, ColumnID: 3, Timestamp: 1520268300}, // 2018-03-05 16:45:00
pilosa.Column{RowID: 7, ColumnID: 1, Timestamp: 1330965900}, // 2012-03-05 16:45:00
})
} Is it possible that some of the timestamps in your data overflows |
My timestamp was in nanos - see that you expect it in seconds - fixed that in my code and it started to work ok. Didn't have any problems with this before when timestamps were handled on the server - might be a good idea to duplicate logic from there in the client so that that kind of bugs are avoided? |
Thanks for finding out this bug. I've created a separate issue for that: #203 |
I've pushed a fix to: #204, so timestamps are nanoseconds. Most probably it will be merged today. |
The fix is in the master. |
@dmibor Can we close this issue? |
yes, works good now |
Great! |
Trying to import using Pilosa cluster master branch - returns error "starting field import for segment: doing import: Server error 415 Unsupported Media Type body:'Unsupported media type" - server expects "application/x-protobuf" but client sends "application/x-binary" to roaring import endpoint
The text was updated successfully, but these errors were encountered: