parquet-go-source
parquet-go-source copied to clipboard
Not able to create file writer with NewS3FileWriterWithClient() for minio source
Hello, I am trying to create a file writer with minio source using NewS3FileWriterWithClient.
fileWriter, err := minio.NewS3FileWriterWithClient(
context.Background(),
minioClient,
bucketName,
objectName,
)
As minio client I am using the minio go client :
minioClient, err := origMinio.New("<minio-endpoint>", &origMinio.Options{
Creds: credentials.NewStaticV4("<access-key-id>", "<access-key>", ""),
Secure: true,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
},
})
I am using self signed certificates that is why I am using InsecureSkipVerify for my testing purposes right now.
For some reason NewS3FileWriterWithClient() does not return anything, neither an error nor anything else. Does anybody know what I could do?
Thanks for helping :)
I have the same problem even with no SSL for my local testing.
fw, err := mins.NewS3FileWriterWithClient(ctx, minioClient, bucketName, objectName)
It hang and never returned...
And minioClient works fine with PutObject() on its own.
Any idea to fix? Thanks!
Edit: Oh, just saw the fix. and PR is not merged... Thx.
Edit 2: write was successful with the fix. but read failed:
fr, err := mins.NewS3FileReaderWithClient(ctx, minioClient, bucketName, objectName)
if err != nil {
log.Println("Can't open file")
return
}
pr, err := reader.NewParquetReader(fr, new(Student), 4)
if err != nil {
log.Println("Can't create parquet reader:", err)
return
}
this resulted in
025/02/25 11:05:28 Can't create parquet reader: Object is nil
I could read the file downloaded with minioClient.FGetObject(). Any idea to fix this? Thanks.
Edit 3: Seems not many people are using the minio source. I was able to make it work with s3v2 and redirect to the minio endpoint.