Skip to content
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

ничего не работает #594

Open
vadinabronin opened this issue Jul 26, 2024 · 1 comment
Open

ничего не работает #594

vadinabronin opened this issue Jul 26, 2024 · 1 comment

Comments

@vadinabronin
Copy link

vadinabronin commented Jul 26, 2024

	a1  float64  `parquet:"name=a1, type=DOUBLE, convertedtype=DATE"`
	a2  float64  `parquet:"name=a2, type=DOUBLE, convertedtype=DATE"`
    a3  int64    `parquet:"name=a3, type=INT64, convertedtype=DATE"`
}

func save3files(filename string,a1 []float64,a2 []float64,a3 []int64) {
    //fmt.Println(len(a1),len(a2),len(a3))
    fw, err := local.NewLocalFileWriter(filename)
	if err != nil {
		panic(err)
	}
    pw, err := writer.NewParquetWriter(fw, new(LoadStruct), 2)
    if err != nil {
        panic(err)
    }
    
    for i := 0;i < len(a1);i++{
        st := LoadStruct{a1: a1[i],a2: a2[i],a3: a3[i]}
        if err := pw.Write(st); err != nil {
            panic(err)
        }
    }
    if err := pw.WriteStop(); err != nil {
        panic(err)
    }

    fileInfo, err := os.Stat(filename)
    if err != nil {
        panic(err)
    }
    fmt.Printf("Размер файла после записи: %d байт\n", fileInfo.Size())
    fw.Close()
}``` 

panic: interface conversion: interface {} is nil, not int64 - че это за херня какой nil при pw.WriteStop
@hangxie
Copy link
Contributor

hangxie commented Oct 3, 2024

Primitive type for DATE should be INT32, check https://github.com/xitongsys/parquet-go?tab=readme-ov-file#logical-type

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants