Skip to content

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

@kbuci

Description

@kbuci

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 #18958 (comment) 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:devtaskDevelopment tasks and maintenance work

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions