Skip to content

Conversation

@plusplusjiajia
Copy link
Member

@plusplusjiajia plusplusjiajia commented Jan 13, 2026

Purpose

Add row filter & column masking support for table read

TableQueryAuth queryAuth =
((FileStoreTable) table).catalogEnvironment().tableQueryAuth(options);
TableQueryAuthResult authResult =
queryAuth.auth(readType == null ? null : readType.getFieldNames());
Copy link
Contributor

Choose a reason for hiding this comment

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

New Read will invoked in every works. We should not let so many works to do RPC to metastore.

I think maybe we can introduce QueryAuthSplit with filter and masking. And here wrapping new TableRead to do filter and masking.

public void testColumnMasking() {
spark.sql(
"CREATE TABLE t_column_masking (id INT, secret STRING, email STRING, phone STRING) TBLPROPERTIES"
+ " ('bucket'='1', 'bucket-key'='id', 'file.format'='avro', 'query-auth.enabled'='true')");
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't need to test bucketed table. Just no bucket.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't need to test bucketed table. Just no bucket.

done


Map<String, Transform> columnMasking = new HashMap<>();
columnMasking.put("secret", maskTransform);
restCatalogServer.setColumnMaskingAuth(
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add case for row filtering.

Copy link
Member Author

Choose a reason for hiding this comment

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

Also add case for row filtering.

done

@plusplusjiajia plusplusjiajia force-pushed the column-masking branch 2 times, most recently from 7bc811f to 5cc62fd Compare January 14, 2026 06:40
@plusplusjiajia plusplusjiajia changed the title [core] Add column masking support for table read [core] Add row filter & column masking support for table read Jan 14, 2026

/** Input splits. Needed by most batch computation engines. */
public class DataSplit implements Split {
public class DataSplit implements QueryAuthSplit {
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't modify DataSplit, just create a new class to wrap it.
DataSplit has a heavy historical burden, and we need to ensure its compatibility. Its serialization protocol is related to multiple languages.

Copy link
Member Author

Choose a reason for hiding this comment

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

Don't modify DataSplit, just create a new class to wrap it.
DataSplit has a heavy historical burden, and we need to ensure its compatibility. Its serialization protocol is related to multiple languages.

Got it!

@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit e15be4a into apache:master Jan 14, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants