Fix HDFS extra configurations in native writer#542
Draft
yangzhg wants to merge 1 commit intobytedance:mainfrom
Draft
Fix HDFS extra configurations in native writer#542yangzhg wants to merge 1 commit intobytedance:mainfrom
yangzhg wants to merge 1 commit intobytedance:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes Hive native HDFS writer behavior so HDFS client “extra configurations” provided via connector/session properties are applied when creating libhdfs clients, and ensures the HDFS filesystem cache is isolated across different effective extra-configuration sets.
Changes:
- Added
hive.hdfs-extra-configurationsas a Hive connector property and applied these key/value pairs to the libhdfs builder viaBuilderConfSetStrbefore connecting. - Updated the HDFS filesystem cache key to include a normalized digest of the effective extra configurations to avoid cross-contamination between clients with different builder configs.
- Merged session-level
hive.hdfs-extra-configurationsinto the connector properties used for writerFileSinkcreation; added unit tests for parsing/cache-key behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| bolt/connectors/hive/storage_adapters/hdfs/tests/HdfsUtilTest.cpp | Adds tests for parsing extra configurations and for cache-key digest normalization/non-leakage of raw values. |
| bolt/connectors/hive/storage_adapters/hdfs/RegisterHdfsFileSystem.cpp | Switches the global HDFS filesystem cache to key by (endpoint identity + extra-config digest). |
| bolt/connectors/hive/storage_adapters/hdfs/HdfsUtil.h | Introduces helpers to parse extra configs and compute a normalized fingerprint/digest + cache key. |
| bolt/connectors/hive/storage_adapters/hdfs/HdfsFileSystem.cpp | Applies parsed extra configurations to the libhdfs builder before connecting. |
| bolt/connectors/hive/HiveDataSink.cpp | Overrides connector properties with session hive.hdfs-extra-configurations for writer sink creation. |
| bolt/connectors/hive/HiveConfig.h | Defines the new connector property key constant and documents its encoding format. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
@codex review |
e4272e5 to
87aad92
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #541
Type of Change
Description
This change adds explicit HDFS open-file session options for the native HDFS path:
bolt.io.file.buffer.sizebolt.dfs.replicationbolt.dfs.blocksizeHive reads and writes now copy these values from connector session properties into
FileOptions. The HDFS FileSystem consumes them when opening files and passes them directly tohdfsOpenFileasbufferSize,replication, andblockSize.The write sink path now forwards
FileSink::Options::fileOptionstoopenFileForWrite, allowing per-session HDFS write options to reach the native writer. The filesystem cache key is unchanged, since these options affect individualfile-open calls rather than the cached HDFS client connection.
When the options are not set, Bolt continues to pass
0for these arguments, preserving the existing libhdfs default behavior.Performance Impact
No Impact: This change does not affect the critical path (e.g., build system, doc, error handling).
Positive Impact: I have run benchmarks.
Click to view Benchmark Results
Negative Impact: Explained below (e.g., trade-off for correctness).
Release Note
Please describe the changes in this PR
Release Note:
Checklist (For Author)
Breaking Changes
No
Yes (Description: ...)
Click to view Breaking Changes