apache / apache/hudi

[Flink][Blob phase 1] Allow FlinkSQL reads to materialize OOL blobs

Open
#19,032 0 comments 0 reactions 0 assignees View on GitHub
type:devtask
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

### Task Description

Users should be able to run FlinkSQL queries with `read_blob` against fields that are OOL blobs. Similar to SparkSQL, our implementation should ideally not send a DFS pread request for each field/row - rather we should aim to group requests in batches and issue API calls for consecutive byte ranges. Specifically, `hoodie.blob.batching.max.gap.bytes` and `hoodie.blob.batching.lookahead.size` should still be honored if set by user

### Approach

Instead of adding a read_blob UDF,
- Create a iterator wrapper `ClosableIterator` that, when `next` is invoked, loads a batch of `hoodie.blob.batching.lookahead.size` records, and similar to Spark, sorts them and issues pre-read calls and materializes the blob data in records
- For FlinkV2 - call it in HoodieSplitReaderFunction for each record batch
- For Legacy Flink - call MergeOnReadInputFormat.initIterator

In order for HUDI to be able to infer which blob fields should be "materialized", we can require users to pass in https://github.com/apache/hudi/pull/18958#issuecomment-4725262176 blob-related configs in the Flink DDL.

### Related Issues

**Parent feature issue:** (if applicable )
**Related issues:**
NOTE: Use `Relationships` button to add parent/blocking issues after issue is created.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading HoodieSplitReaderFunction for FlinkV2 and MergeOnReadInputFormat.initIterator for legacy Flink, then trace how record batches and OOL blob fields are read. Review the Spark-side batching behavior and the ClosableIterator approach described in the issue. Done means FlinkSQL read_blob works for OOL blobs while honoring hoodie.blob.batching.max.gap.bytes and hoodie.blob.batching.lookahead.size without one DFS pread per field or row.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, sql
Domain
data-engineering, stream-processing
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.