Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ColumnMask is enabled before aggregation, rather than after aggregation. #21934

Closed
jywjyw opened this issue May 11, 2024 · 1 comment
Closed

Comments

@jywjyw
Copy link

jywjyw commented May 11, 2024

When using ColumnMask, I encounter an issue where ColumnMask is enabled before aggregation, rather than after aggregation.
For example, I have this table about person:

name 
------
Jim
Bob

Then implement columnMask:

public class MySysAcl implements SystemAccessControl {
    public Optional<ViewExpression> getColumnMask(SystemSecurityContext context, CatalogSchemaTableName cst, String columnName, Type type)    {
		return Optional.of(ViewExpression.builder()
				.identity("root")
				.catalog(cst.getCatalogName())   					
				.schema(cst.getSchemaTableName().getSchemaName())	
				.expression("'***'")
				.build());
    	}
    }
}

When execute "SELECT * FROM T", looks fine:

name
-----
***
***

But when execute "SELECT COUNT(DISTINCT NAME) FROM T", I got:

count
-----
1

I believe it should return 2, as ColumnMask should take effect during display rather than during computation.

Somebody has submitted similar issue: #17696.

If I want to perform column masking only when displaying query results, can I do it by implementing connector? Thanks very much!

@findepi
Copy link
Member

findepi commented May 14, 2024

This is working as designed.
closing in favor of #17696. let's continue discussion there

@findepi findepi closed this as not planned Won't fix, can't repro, duplicate, stale May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants