joellubi commented on issue #43640:
URL: https://github.com/apache/arrow/issues/43640#issuecomment-2291262619

   > One question: If I understand correctly, to implement such 
`MonthDayMillis` for writing to parquet, I will only need to implement 
`ParquetLogicalType` for it (while other methods like `Value` and `MarshalJSON` 
are not required), am I correct?
   
   Correct. You are only required to implement the `ExtensionType` interface 
which is fairly simple, to which you can add `ParquetLogicalType`. The 
`ExtensionArray` and `ExtensionBuilder` interfaces are optional and just make 
it more convenient to read/write the array.
   
   If you just write the underlying storage array (`FixedSizeBinary<12>`) 
you'll be appending `[]byte` records which can be produced by getting the byte 
representations of the `uint32` values and concatenating in the slice. The 
`ExtensionBuilder` interface can optionally be used to consolidate this logic, 
so that you have a simpler interface while writing e.g. `bldr.Append(month, 
day, millis uint32)`.
   
   > p/s If it's true that parquet Interval does not support negative intervals 
then I can't use it anyway 😄. But this enhancement will probably still be 
useful in other scenarios.
   
   Ah that's unfortunate! There may still be some other options, such as 
perhaps writing multiple columns or a struct array.


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