Skip to content

HIVE-27575: MASK_HASH UDF generate a log per row - #4558

Merged
ayushtkn merged 2 commits into
apache:masterfrom
okumin:HIVE-27575-mask-hash
Aug 9, 2023
Merged

HIVE-27575: MASK_HASH UDF generate a log per row#4558
ayushtkn merged 2 commits into
apache:masterfrom
okumin:HIVE-27575-mask-hash

Conversation

@okumin

@okumin okumin commented Aug 7, 2023

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Avoid too many logs from being written.
https://issues.apache.org/jira/browse/HIVE-27575

Why are the changes needed?

Prevent disk-full or overhead.

Does this PR introduce any user-facing change?

No

Is the change a dependency upgrade?

No

How was this patch tested?

I checked the log is written only once.

hive-hiveserver2-859d7686f7-xwhrh: 2023-08-07T22:35:11,886  INFO [6a60330d-5988-48fb-9a94-23d9f6e5f334 HiveServer2-Handler-Pool: Thread-59] generic.MaskHashTransformer: Use SHA256 for masking

if (SessionState.get() != null) {
return "sha512".equalsIgnoreCase(
isSha512 = "sha512".equalsIgnoreCase(
HiveConf.getVar(SessionState.get().getConf(), HiveConf.ConfVars.HIVE_MASKING_ALGO).trim());

@okumin okumin Aug 7, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I observed this is also invoked every row when it runs on HiveServer2 with fetch task conversion

@okumin

okumin commented Aug 8, 2023

Copy link
Copy Markdown
Contributor Author

@ayushtkn Could you please review this PR? This is a follow-up of #3750. I know some environments heavily use this UDF because this is implicitly used with Ranger.

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we just remove the log line or change it to debug? On a quick look it seems we are doing more than just removing the log line here?

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2023

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

warning The version of Java (11.0.8) you have used to run this analysis is deprecated and we will stop accepting it soon. Please update to at least Java 17.
Read more here

@ayushtkn ayushtkn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@okumin

okumin commented Aug 9, 2023

Copy link
Copy Markdown
Contributor Author

Thanks. I decided to address only the logging part. I wonder if it could be not the best to access Configuration every row. But I postpone checking or improving that part until I am sure that we should fix it.

@ayushtkn
ayushtkn merged commit a406d6d into apache:master Aug 9, 2023
tarak271 pushed a commit to tarak271/hive-1 that referenced this pull request Dec 19, 2023
@okumin
okumin deleted the HIVE-27575-mask-hash branch October 11, 2025 01:56
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.

3 participants