joellubi commented on code in PR #43625:
URL: https://github.com/apache/arrow/pull/43625#discussion_r1713465394


##########
go/parquet/pqarrow/encode_arrow.go:
##########
@@ -607,6 +607,30 @@ func writeDenseArrow(ctx *arrowWriteContext, cw 
file.ColumnChunkWriter, leafArr
                                }
                                wr.WriteBatchSpaced(data, defLevels, repLevels, 
arr.NullBitmapBytes(), int64(arr.Data().Offset()))
                        }
+               case *arrow.MonthDayNanoIntervalType:
+                       arr := leafArr.(*array.MonthDayNanoInterval)
+                       data := make([]parquet.FixedLenByteArray, arr.Len())
+
+                       // NOTE: parquet Interval only supports 32-bit 
milliseconds so we are truncating Nanoseconds to milliseconds
+                       if arr.NullN() == 0 {
+                               for idx := range data {
+                                       data[idx] = 
make(parquet.FixedLenByteArray, 12)
+                                       
binary.LittleEndian.PutUint32(data[idx][:4], uint32(arr.Value(idx).Months))

Review Comment:
   I think there may be more logic involved in this conversion. The arrow 
values for each of these are 
[signed](https://github.com/apache/arrow/blob/main/format/Schema.fbs#L409-L415) 
integers, which means the conversion would need to account for negative values 
as well.



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