Redact storage paths from physical_plan in profile API responses - #22747
Conversation
PR Reviewer Guide 🔍(Review updated until commit 6be3271)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 6be3271 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 45d07e6
Suggestions up to commit 45d07e6
Suggestions up to commit 45d07e6
Suggestions up to commit 45d07e6
Suggestions up to commit 45d07e6
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22747 +/- ##
============================================
+ Coverage 71.57% 71.59% +0.01%
- Complexity 77269 77357 +88
============================================
Files 6170 6170
Lines 359774 359870 +96
Branches 52478 52487 +9
============================================
+ Hits 257504 257632 +128
+ Misses 81801 81773 -28
+ Partials 20469 20465 -4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
18af1e8 to
45d07e6
Compare
|
Persistent review updated to latest commit 45d07e6 |
|
One flaky test failing: |
|
Persistent review updated to latest commit 45d07e6 |
|
Flaky tests: |
|
Persistent review updated to latest commit 45d07e6 |
|
Another flaky test: |
|
Persistent review updated to latest commit 45d07e6 |
|
Persistent review updated to latest commit 45d07e6 |
|
❕ Gradle check result for 45d07e6: UNSTABLE Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure. |
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit 9db5b7c. ⛔ Hard block: Issues at Medium severity or above will block this PR from merging. 'Diff too large, requires skip by maintainers after manual review' Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
9db5b7c to
7a198db
Compare
DataFusion's Display impl for file-scan nodes (DataSourceExec,
ParquetExec) always embeds the real storage location(s) it's reading
from -- local filesystem paths, or object-store URIs/keys when backed
by S3/GCS/Azure. The profile=true API surfaces this verbatim to any
caller already authorized to run the query, exposing internal
storage layout (and potentially bucket/key naming) that callers don't
need to see.
Strips the file_groups={...} path list in QueryProfileBuilder --
the single chokepoint all stage types (SHARD_FRAGMENT,
COORDINATOR_REDUCE, LATE_MATERIALIZATION) funnel their physical_plan
text through -- while preserving the group count, which remains
useful for diagnosing scan fan-out without leaking storage paths.
Verified against real DataFusion output on a live cluster:
Before: DataSourceExec: file_groups={1 group: [[/actual/path/...]]}
After: DataSourceExec: file_groups={1 group: <redacted>}
Signed-off-by: Finnegan Carroll <carrofin@amazon.com>
Signed-off-by: Finn Carroll <carrofin@amazon.com>
Adds end-to-end coverage for the redaction: runs a profile=true query that produces a real DataSourceExec scan and asserts no physical_plan across any stage/task leaks a filesystem path (.parquet), data dir (/nodes/), or object-store URI (s3://), while file_groups shows the <redacted> marker. Guards with a sawFileGroups check so it can't vacuously pass. Complements the existing QueryProfileBuilderRedactionTests unit coverage with a real-cluster check. Signed-off-by: Finnegan Carroll <carrofin@amazon.com> Signed-off-by: Finn Carroll <carrofin@amazon.com>
|
Persistent review updated to latest commit 6be3271 |
Summary
DataFusion's
Displayimplementation for file-scan nodes (DataSourceExec,ParquetExec) provides the local filesystem paths it is reading from. Theprofile=trueAPI surfaces thisphysical_plantext verbatim back to the caller, exposing internal storage details unnecessarily.Fix
All stage types (
SHARD_FRAGMENT,COORDINATOR_REDUCE,LATE_MATERIALIZATION) funnel theirphysical_plantext throughQueryProfileBuilder.parseDataNodePayload().This change adds a regex redaction there for
file_groups={...}to strip the full path.Testing