mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-04 06:18:17 +00:00
feat: column masking policy is an ObjectName
This commit is contained in:
parent
7a91726074
commit
c111c21cea
3 changed files with 6 additions and 6 deletions
|
@ -1651,7 +1651,7 @@ pub struct ColumnPolicyProperty {
|
|||
/// ```
|
||||
/// [Snowflake]: https://docs.snowflake.com/en/sql-reference/sql/create-table
|
||||
pub with: bool,
|
||||
pub policy_name: Ident,
|
||||
pub policy_name: ObjectName,
|
||||
pub using_columns: Option<Vec<Ident>>,
|
||||
}
|
||||
|
||||
|
|
|
@ -1177,7 +1177,7 @@ fn parse_column_policy_property(
|
|||
parser: &mut Parser,
|
||||
with: bool,
|
||||
) -> Result<ColumnPolicyProperty, ParserError> {
|
||||
let policy_name = parser.parse_identifier()?;
|
||||
let policy_name = parser.parse_object_name(false)?;
|
||||
let using_columns = if parser.parse_keyword(Keyword::USING) {
|
||||
parser.expect_token(&Token::LParen)?;
|
||||
let columns = parser.parse_comma_separated(|p| p.parse_identifier())?;
|
||||
|
|
|
@ -731,7 +731,7 @@ fn test_snowflake_create_table_with_columns_masking_policy() {
|
|||
option: ColumnOption::Policy(ColumnPolicy::MaskingPolicy(
|
||||
ColumnPolicyProperty {
|
||||
with,
|
||||
policy_name: "p".into(),
|
||||
policy_name: ObjectName::from(vec![Ident::new("p")]),
|
||||
using_columns,
|
||||
}
|
||||
))
|
||||
|
@ -765,7 +765,7 @@ fn test_snowflake_create_table_with_columns_projection_policy() {
|
|||
option: ColumnOption::Policy(ColumnPolicy::ProjectionPolicy(
|
||||
ColumnPolicyProperty {
|
||||
with,
|
||||
policy_name: "p".into(),
|
||||
policy_name: ObjectName::from(vec![Ident::new("p")]),
|
||||
using_columns: None,
|
||||
}
|
||||
))
|
||||
|
@ -852,7 +852,7 @@ fn test_snowflake_create_table_with_several_column_options() {
|
|||
option: ColumnOption::Policy(ColumnPolicy::MaskingPolicy(
|
||||
ColumnPolicyProperty {
|
||||
with: true,
|
||||
policy_name: "p1".into(),
|
||||
policy_name: ObjectName::from(vec![Ident::new("p1")]),
|
||||
using_columns: Some(vec!["a".into(), "b".into()]),
|
||||
}
|
||||
)),
|
||||
|
@ -890,7 +890,7 @@ fn test_snowflake_create_table_with_several_column_options() {
|
|||
option: ColumnOption::Policy(ColumnPolicy::ProjectionPolicy(
|
||||
ColumnPolicyProperty {
|
||||
with: false,
|
||||
policy_name: "p2".into(),
|
||||
policy_name: ObjectName::from(vec![Ident::new("p2")]),
|
||||
using_columns: None,
|
||||
}
|
||||
)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue