Skip to content

HIVE-29227: Apply masking in memory instead of rewriting the file in QOutProcessor#maskPatterns#6632

Open
cyanzheng2926 wants to merge 1 commit into
apache:masterfrom
cyanzheng2926:HIVE-29227_mask_in_memory
Open

HIVE-29227: Apply masking in memory instead of rewriting the file in QOutProcessor#maskPatterns#6632
cyanzheng2926 wants to merge 1 commit into
apache:masterfrom
cyanzheng2926:HIVE-29227_mask_in_memory

Conversation

@cyanzheng2926

Copy link
Copy Markdown
Contributor

Refactored masking from QOutProcessor#maskPatterns that involves file rewrite to in-memory implementation for CliDriver and BeeLine.

What changes were proposed in this pull request?

Removed QOutProcessor#maskPatterns() which rewrites the whole file when masking.
Added in-stream masking methods and states, including maskAndFoldLine(), maskLines(), maskContent(), and MaskingFoldState while retaining the original semantics. Splitted multiline println() on \n for PREHOOK/POSTHOOK text
Wrapped both stdout and stderr with QTestFetchConverter to perform mask before sort for CliDriver. For BeeLine retained original sort before mask behaviour and applied masking on the !record stream.

Why are the changes needed?

Currently masking may be applied in multiple locations and also involves re-writing the q.out files after test execution, causing duplicate effort. The change performs masking in memory on the capture stream.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Tested and validated with multiple existing qfiles with TestMiniLlapLocalCliDriver, TestMiniLlapCliDriver, TestCliDriver, TestMiniTezCliDriver, TestBeeLineDriver
Also added unit test under TestQOutProcessor

…QOutProcessor#maskPatterns

Refactored masking from QOutProcessor#maskPatterns that involves file rewrite to in-memory implementation  for CliDriver and BeeLine.
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants