[common] Support catalog context without Hadoop configuration#8193
Conversation
|
Added the Trino 440 companion branch that consumes this API:
The Trino side uses Validation run locally:
|
|
@JingsongLi PTAL. This is a narrower follow-up to #6653 based on your previous feedback:
Thanks. |
|
Additional Trino 440 companion validation passed locally on branch https://github.com/tchivs/trino/tree/paimon/trino-440-paimon-1.5:
|
| hadoopConf == null ? getHadoopConfiguration(options) : hadoopConf); | ||
| hadoopConf == null && !loadHadoopConf | ||
| ? null | ||
| : new SerializableConfiguration( |
There was a problem hiding this comment.
Can you just create a method and do try catch? If there is no Hadoop class, set it directly to NULL.
There was a problem hiding this comment.
Thanks for the suggestion. I updated this in 8924d69: the extra loadHadoopConf flag and createWithoutHadoop API were removed, and CatalogContext now uses a private helper to load Hadoop configuration with try/catch. If Hadoop classes are not available, the stored Hadoop configuration is set to null.
I also updated the no-Hadoop classloader test to use the existing CatalogContext.create(options, preferIOLoader, fallbackIOLoader) path and verify the Hadoop configuration is null while catalog creation still works.
Local checks passed:
- mvn -pl paimon-core -am -Pfast-build -DfailIfNoTests=false -Dtest=CatalogFactoryTest test
- mvn -pl paimon-core spotless:check
GitHub Actions are running on the updated commit now.
|
+1 |
Purpose
This is a narrower follow-up to #6653 for engines such as Trino that provide their own FileIO and should not require Hadoop configuration initialization.
Instead of refactoring the FileIO/CatalogContext hierarchy, this keeps all existing
CatalogContext.create(...)behavior unchanged and adds an explicitCatalogContext.createWithoutHadoop(...)factory for the no-Hadoop path.Changes
CatalogContext.create(...)overloads loading Hadoop configuration by default for compatibility.CatalogContext.createWithoutHadoop(...)for callers that provide their ownFileIOLoader.hadoopConf()fail with a clearIllegalStateExceptionwhen called on a Hadoop-free context.Tests
mvn -pl paimon-core -am -Pfast-build -DfailIfNoTests=false -Dtest=CatalogFactoryTest testmvn -pl paimon-common -am -Pfast-build -DfailIfNoTests=false -Dtest=FileIOTest,ResolvingFileIOTest testNotes
A companion Trino change is being prepared to consume this API by passing Trino's FileIO loader and disabling Hadoop default configuration loading.