lidavidm commented on code in PR #707:
URL: https://github.com/apache/arrow-go/pull/707#discussion_r2935228535


##########
parquet/file/column_writer_types.gen.go.tmpl:
##########
@@ -347,6 +411,61 @@ func (w *{{.Name}}ColumnChunkWriter) 
writeValuesSpaced(spacedValues []{{.name}},
   }
 }
 
+{{if eq .Name "Boolean"}}
+// writeBitmapValues writes boolean values directly from a bitmap
+func (w *{{.Name}}ColumnChunkWriter) writeBitmapValues(bitmap []byte, 
bitmapOffset int64, numValues, numNulls int64) {
+  // Check if encoder supports bitmap interface
+  type bitmapEncoder interface {
+    PutBitmap(bitmap []byte, offset int64, length int64)
+  }
+
+  if enc, ok := w.currentEncoder.(bitmapEncoder); ok {
+    enc.PutBitmap(bitmap, bitmapOffset, numValues)
+  } else {
+    // Fallback: convert to []bool (slower but compatible)
+    values := make([]bool, numValues)
+    for i := int64(0); i < numValues; i++ {
+      values[i] = bitutil.BitIsSet(bitmap, int(bitmapOffset+i))
+    }
+    w.currentEncoder.(encoding.BooleanEncoder).Put(values)
+  }
+
+  // Note: Statistics and bloom filter updates would require converting back 
to []bool
+  // For now, skip them to maintain the performance benefit

Review Comment:
   (Is there an issue filed for this?)



-- 
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]

Reply via email to