a-narsudinov commented on PR #20643: URL: https://github.com/apache/hudi/pull/20643#issuecomment-7198000627
> Thanks for the contribution! This lets Trino read an initialized Hudi table that has no completed commit as an empty table instead of failing with `HUDI_NO_VALID_COMMIT`, which also matches upstream Trino behaviour. > > I pushed a follow-up commit on top of yours (`9d7fb39f41ef`) rather than going back and forth on small points: > > * The empty-table check moved from `HudiSplitManager.getSplits` into the background split loader in `HudiSplitSource`, and the directory lister and split loader are now built on that executor too, so `getSplits` no longer loads the meta client or timeline on the planning thread. One behaviour change: a failure while building them now surfaces as "Failed to generate splits" instead of being thrown from `getSplits`. > * `testInitializedTableWithoutCommits` now pins each guard. A `WHERE id = 1` query covers the schema lookup done by index planning when the metadata table and column-name casing are both on, and a MERGE_ON_READ table in CUSTOM merge mode covers the `getMergeRequiredColumns` guard. Table statistics are left at the default. > * Smaller cleanups: the test reuses `ResourceHudiTablesInitializer.createTable`, derives its location from an existing table, and the now-unused `HUDI_NO_VALID_COMMIT` code is retired the same way codes 0 and 3 are. > > I also updated the Summary and Validation sections of the description to match the second commit. Could you take a look and say if anything there, or in the commit, does not match what you intended? Thanks for the additional improvements, they align well with my original intent, and moving initialization off the planning thread makes this better. There is just one potential edge case I wanted to highlight. We ran into a similar issue while migrating from trino’s built-in hudi connector to the plugin maintained in apache/hudi: a missing runtime dependency caused a NoClassDefFoundError when reading table metadata. With initialization now happening in the background, an error like this could leave the query waiting for splits instead of failing promptly. Since `catch (Exception)` does not catch `NoClassDefFoundError`, the failure would remain in the scheduled task’s future without notifying the error listener or finishing the split queue. From the user’s perspective, the query could appear stuck until cancellation or timeout. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
