-
Notifications
You must be signed in to change notification settings - Fork 294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WriteStop error runtime error: invalid memory address or nil pointer dereference #550
Comments
I'm also seeing this, an unexpected |
I have the same issue here and use the same version, 1.6.2. Does anyone know what it could be? |
I am facing the same issue v1.6.2. |
Any updates on this? Facing same issue |
Facing similar issue. Any updates on this? |
same thing |
@xitongsys Facing similar issue with writeStop function call. any update |
I was running into this and found that my problem was that I think a few improvements could be made:
|
I'm also having this issue; in my case it is coming from common/common.go: ...
func FindFuncTable(pT *parquet.Type, cT *parquet.ConvertedType, logT *parquet.LogicalType) FuncTable {
if cT == nil && logT == nil {
if *pT == parquet.Type_BOOLEAN { //pT is null so panics when try to deference
return boolFuncTable{}
... This is my repro: package main
import (
"bytes"
"github.com/xitongsys/parquet-go/parquet"
"github.com/xitongsys/parquet-go/writer"
)
type person struct {
Age int `json:"age"`
Name string `json:"name"`
}
func main() {
people := []*person{
{
Age: 10,
Name: "bob",
},
{
Age: 12,
Name: "fred",
},
}
buf := &bytes.Buffer{}
pw, err := writer.NewParquetWriterFromWriter(buf, people[0], 1)
if err != nil {
panic(err)
}
pw.RowGroupSize = 128 * 1024 * 1024 //128M
pw.CompressionType = parquet.CompressionCodec_SNAPPY
for _, item := range people {
if err = pw.Write(item); err != nil {
panic(err)
}
}
// panic occurs in WriteStop
if err = pw.WriteStop(); err != nil {
panic(err)
}
} |
I ran into the same issue as @mikemherron and was able to resolve it by adding type person struct {
Age int `json:"age" parquet:"type=INT32"`
Name string `json:"name" parquet:"type=BYTE_ARRAY"`
} I'm guessing this isn't the same problem as the initial issue reported. The documentation and examples use the @xitongsys Maybe when returning from NewSchemaHandlerFromStruct you could check if parquet-go/schema/schemahandler.go Lines 400 to 404 in 75e935f
|
Getting error during write stop with invalid memory address or nil pointer dereference.
`package main
import (
"fmt"
"encoding/json"
)
func main(){
var err error
md :=
{ "Tag": "name=parquet-go", "Fields": [ {"Tag": "name=name, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"}, { "Tag": "name=data__CronJob, type=LIST", "Fields": [ { "Tag": "name=element, type=MAP", "Fields":[ {"Tag": "name=key, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"}, {"Tag": "name=val, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"} ] } ] }, { "Tag": "name=data__Pod, type=LIST", "Fields": [ { "Tag": "name=element, type=MAP", "Fields":[ {"Tag": "name=key, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"}, {"Tag": "name=val, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"} ] } ] }, { "Tag": "name=data__Job, type=LIST", "Fields": [ { "Tag": "name=element, type=MAP", "Fields":[ {"Tag": "name=key, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"}, {"Tag": "name=val, type=BYTE_ARRAY, convertedtype=UTF8, repetitiontype=OPTIONAL"} ] } ] } ] }
}
`
The text was updated successfully, but these errors were encountered: