apache / apache/iceberg

API, Spark: Add direct UUID string-to-ByteBuffer conversion

Open
#16,003 0 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
9.2k
Forks
3.5k
Avg merge
2d 11h
Merged PRs (30d)
132

Description

### Feature Request / Improvement

Resolve the TODO in `SparkValueWriters.UUIDWriter` by adding a direct UUID string-to-ByteBuffer conversion path that avoids intermediate object allocations.

**Problem**

The current Spark UUID write path creates two unnecessary intermediate objects per row:

1. `s.toString()` - allocates a `String` and decodes UTF-8
2. `UUID.fromString()` - heavy parsing (regex, splits, Long.parseLong) to create a `UUID` that is immediately destructured back into two longs for the ByteBuffer.

### Query engine

None

### Willingness to contribute

- [ ] I can contribute this improvement/feature independently
- [x] I would be willing to contribute this improvement/feature with guidance from the Iceberg community
- [ ] I cannot contribute this improvement/feature at this time

Contributor guide

Open the contributing guide

Research direction

Start at SparkValueWriters.UUIDWriter and trace the current write path to understand how the string reaches the ByteBuffer. Confirm completion by comparing the resulting bytes and ensuring the conversion no longer performs the two intermediate allocations described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spark
Domain
data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.