databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.85k stars 750 forks source link

Feature: Policy return null(string) #14816

Closed wubx closed 2 months ago

wubx commented 8 months ago

Summary

https://docs.databend.com/sql/sql-commands/ddl/mask-policy/create-mask-policy#examples

CREATE TABLE user_info (
    id INT,
    email STRING
);
CREATE MASKING POLICY email_mask
AS
  (val string)
  RETURNS string ->

ALTER TABLE user_info MODIFY COLUMN email SET MASKING POLICY email_mask; error: APIError: ResponseError with 1114: Column 'email' data type string null does not match to the mask policy type string

becuse email is varchar null

sundy-li commented 2 months ago
🐳 :) CREATE MASKING POLICY email_mask
AS
  (val string)
  RETURNS string -> 'a';
processed in (0.045 sec)