Skip to content

[HUDI-4142][RFC-64] New APIs to facilitate faster Query Engine integrations - #7080

Open
alexeykudinkin wants to merge 14 commits into
apache:masterfrom
onehouseinc:ak/rfc-table-spec-api
Open

[HUDI-4142][RFC-64] New APIs to facilitate faster Query Engine integrations#7080
alexeykudinkin wants to merge 14 commits into
apache:masterfrom
onehouseinc:ak/rfc-table-spec-api

Conversation

@alexeykudinkin

@alexeykudinkin alexeykudinkin commented Oct 28, 2022

Copy link
Copy Markdown
Contributor

Change Logs

This RFC proposes a new set of higher-level Table Spec APIs that would allow us to up-level our current integration model with new Query Engines, enabling faster turnaround for such integrations.

Impact

RFC for discussion

Risk level (write none, low medium or high below)

none

Documentation Update

Implementation of this RFC would require considerable documentation updates to reflect the newly proposed approach of integration for Query Engines as well as user-advised higher-level APIs.

Contributor's checklist

  • Read through contributor's guide
  • Change Logs and Impact were stated clearly
  • Adequate tests were added if applicable
  • CI passed

@xushiyan xushiyan added priority:blocker Production down; release blocker big-needle-movers rfc Request for comments status:in-progress Work in progress labels Oct 31, 2022
@codope
codope force-pushed the ak/rfc-table-spec-api branch 2 times, most recently from 2df0c0f to 03354f8 Compare November 2, 2022 04:49
@codope
codope force-pushed the ak/rfc-table-spec-api branch from a532dbe to 10fc1a9 Compare November 9, 2022 17:19
@alexeykudinkin alexeykudinkin changed the title [WIP] RFC-XX New Table Spec APIs to facilitate faster Query Engine integrations [RFC-64] New Table Spec APIs to facilitate faster Query Engine integrations Nov 10, 2022
@alexeykudinkin alexeykudinkin changed the title [RFC-64] New Table Spec APIs to facilitate faster Query Engine integrations [RFC-64] New APIs to facilitate faster Query Engine integrations Nov 10, 2022
@alexeykudinkin alexeykudinkin removed the status:in-progress Work in progress label Nov 10, 2022
Comment thread rfc/rfc-64/rfc-64.md
```

**Expression** (**Predicate**)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only use for dataSkipping/partition prune ?

we donnot think we should use those predicate for engine scan action。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct this will only be used for data filtering (skipping, partition-pruning, filters push-down)

Comment thread rfc/rfc-64/rfc-64.md
List<PartitionSnapshot> listFilesAt(HoodieInstant instant, Predicate[] filters);
// Lists files added visible/reachable at the instant `to`, that were
// added no earlier than at the instant `from`
List<PartitionIncrementalSnapshot> listFilesBetween(HoodieInstant from, HoodieInstant to, Predicate[] filters);

@xiarixiaoyao xiarixiaoyao Nov 10, 2022

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will FileIndex cache all file information to memory just like BaseHoodieTableFileIndex?
if yes, I think it's not friendly to presto

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiarixiaoyao this will be configurable

Comment thread rfc/rfc-64/rfc-64.md
aforementioned log scanner API. Then, in Presto we can create `RecordCursor`
wrapping around `RecordReader`. The key advantage here is that
the `HoodieRealtimeRecordReader` won't have to spend cycles
converting `ArrayWritable` to `Avro` and vice-versa as it does today.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently for hive/presto, we use MapredParquetInputFormat to read the parquet file and return ArrayWritable records.
Do we want to implement our own Parquet reading logic and return avro type directly to avoid spend cycles
converting ArrayWritable to Avro

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xiarixiaoyao Good question! We don't intend to implement our own Parquet reading logic. The work here will build on top of RFC-46. So, in this case, we will have an implementation of HoodieRecord and HoodieRecordMerger( as proposed in RFC-46) for Hive ArrayWritable.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will custom HoodieRecordMerger implementations be supported and if so how will the reader load those custom implementations that are not part of open source?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@the-other-tim-brown this is covered in RFC-46: If you want to implement custom merging logic, then

  • When creating your table you specify unique MERGER_STRATEGY uuid (identifying your merging strategy/semantic)
  • During writing you specify MERGER_IMPLS, which are actual engine-specific RecordMerger impls, that realize particular merging strategy (set as MERGER_STRATEGY)
  • When writing Hudi will take up MERGER_IMPLS, filter the ones based on the MERGER_STRATEGY uuid, and use them for merging (based on which engine it's running on)

Comment thread rfc/rfc-64/rfc-64.md

## Appendix A: Hive-specific HoodieRecord implementation

Here `HoodieRecord` is an abstraction as defined in RFC-46 and it will provide

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can help implement it.

@codope
codope force-pushed the ak/rfc-table-spec-api branch from a118158 to 3923bcd Compare November 11, 2022 10:06
@codope codope changed the title [RFC-64] New APIs to facilitate faster Query Engine integrations [HUDI-4142][RFC-64] New APIs to facilitate faster Query Engine integrations Nov 12, 2022
@xushiyan xushiyan removed the priority:blocker Production down; release blocker label Jan 25, 2023
@github-actions github-actions Bot added the size:L PR with lines of changes in (300, 1000] label Feb 26, 2024
@vinothchandar vinothchandar self-assigned this Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

big-needle-movers release-1.0.0 rfc Request for comments size:L PR with lines of changes in (300, 1000]

Projects

Status: 🏗 Under discussion

Development

Successfully merging this pull request may close these issues.

6 participants