Skip to content

Conversation

@shangxinli
Copy link
Contributor

Implement direct Avro encoder to eliminate GenericDatum intermediate layer, matching the decoder approach for better performance.

Implementation:

  • Add avro_direct_encoder_internal.h with EncodeArrowToAvro API
  • Add avro_direct_encoder.cc implementing direct Arrow→Avro encoding
    • All primitive types: bool, int, long, float, double, string, binary
    • Temporal types: date, time, timestamp
    • Logical types: uuid, decimal
    • Nested types: struct, list, map (both string and non-string keys)
    • Union type handling for optional fields
  • Modify avro_writer.cc to use DataFileWriterBase with direct encoder
  • Add EncodeContext to reuse scratch buffers and avoid allocations

This matches Java Iceberg implementation using Encoder interface directly, avoiding intermediate object allocation overhead.

Implement direct Avro encoder to eliminate GenericDatum intermediate layer,
matching the decoder approach for better performance.

Implementation:
- Add avro_direct_encoder_internal.h with EncodeArrowToAvro API
- Add avro_direct_encoder.cc implementing direct Arrow→Avro encoding
  - All primitive types: bool, int, long, float, double, string, binary
  - Temporal types: date, time, timestamp
  - Logical types: uuid, decimal
  - Nested types: struct, list, map (both string and non-string keys)
  - Union type handling for optional fields
- Modify avro_writer.cc to use DataFileWriterBase with direct encoder
- Add EncodeContext to reuse scratch buffers and avoid allocations

This matches Java Iceberg implementation using Encoder interface directly,
avoiding intermediate object allocation overhead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant