zeroshade commented on code in PR #2026:
URL: https://github.com/apache/arrow-adbc/pull/2026#discussion_r1691780278
##########
go/adbc/driver/snowflake/bulk_ingestion.go:
##########
@@ -334,20 +334,31 @@ func writeParquet(
parquetProps *parquet.WriterProperties,
arrowProps pqarrow.ArrowWriterProperties,
) error {
- limitWr := &limitWriter{w: w, limit: targetSize}
- pqWriter, err := pqarrow.NewFileWriter(schema, limitWr, parquetProps,
arrowProps)
+ pqWriter, err := pqarrow.NewFileWriter(schema, w, parquetProps,
arrowProps)
if err != nil {
return err
}
defer pqWriter.Close()
+ var bytesWritten int64
for rec := range in {
- err = pqWriter.WriteBuffered(rec)
+ if rec.NumRows() == 0 {
+ rec.Release()
+ continue
+ }
+
+ err = pqWriter.Write(rec)
rec.Release()
if err != nil {
return err
}
- if limitWr.LimitExceeded() {
+
+ if targetSize < 0 {
+ continue
+ }
+
+ bytesWritten += pqWriter.RowGroupTotalBytesWritten()
+ if bytesWritten > int64(targetSize) {
Review Comment:
`>=` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]