@@ -270,8 +270,8 @@ fn test_snowflake_create_table_with_tag() {
270270 assert_eq ! ( "my_table" , name. to_string( ) ) ;
271271 assert_eq ! (
272272 Some ( vec![
273- Tag :: new( "A" . into ( ) , "TAG A" . to_string( ) ) ,
274- Tag :: new( "B" . into ( ) , "TAG B" . to_string( ) )
273+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "A" ) ] ) , "TAG A" . to_string( ) ) ,
274+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "B" ) ] ) , "TAG B" . to_string( ) )
275275 ] ) ,
276276 with_tags
277277 ) ;
@@ -291,8 +291,8 @@ fn test_snowflake_create_table_with_tag() {
291291 assert_eq ! ( "my_table" , name. to_string( ) ) ;
292292 assert_eq ! (
293293 Some ( vec![
294- Tag :: new( "A" . into ( ) , "TAG A" . to_string( ) ) ,
295- Tag :: new( "B" . into ( ) , "TAG B" . to_string( ) )
294+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "A" ) ] ) , "TAG A" . to_string( ) ) ,
295+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "B" ) ] ) , "TAG B" . to_string( ) )
296296 ] ) ,
297297 with_tags
298298 ) ;
@@ -731,7 +731,7 @@ fn test_snowflake_create_table_with_columns_masking_policy() {
731731 option: ColumnOption :: Policy ( ColumnPolicy :: MaskingPolicy (
732732 ColumnPolicyProperty {
733733 with,
734- policy_name: "p" . into ( ) ,
734+ policy_name: ObjectName :: from ( vec! [ Ident :: new ( "p" ) ] ) ,
735735 using_columns,
736736 }
737737 ) )
@@ -765,7 +765,7 @@ fn test_snowflake_create_table_with_columns_projection_policy() {
765765 option: ColumnOption :: Policy ( ColumnPolicy :: ProjectionPolicy (
766766 ColumnPolicyProperty {
767767 with,
768- policy_name: "p" . into ( ) ,
768+ policy_name: ObjectName :: from ( vec! [ Ident :: new ( "p" ) ] ) ,
769769 using_columns: None ,
770770 }
771771 ) )
@@ -802,8 +802,14 @@ fn test_snowflake_create_table_with_columns_tags() {
802802 option: ColumnOption :: Tags ( TagsColumnOption {
803803 with,
804804 tags: vec![
805- Tag :: new( "A" . into( ) , "TAG A" . into( ) ) ,
806- Tag :: new( "B" . into( ) , "TAG B" . into( ) ) ,
805+ Tag :: new(
806+ ObjectName :: from( vec![ Ident :: new( "A" ) ] ) ,
807+ "TAG A" . into( )
808+ ) ,
809+ Tag :: new(
810+ ObjectName :: from( vec![ Ident :: new( "B" ) ] ) ,
811+ "TAG B" . into( )
812+ ) ,
807813 ]
808814 } ) ,
809815 } ] ,
@@ -846,7 +852,7 @@ fn test_snowflake_create_table_with_several_column_options() {
846852 option: ColumnOption :: Policy ( ColumnPolicy :: MaskingPolicy (
847853 ColumnPolicyProperty {
848854 with: true ,
849- policy_name: "p1" . into ( ) ,
855+ policy_name: ObjectName :: from ( vec! [ Ident :: new ( "p1" ) ] ) ,
850856 using_columns: Some ( vec![ "a" . into( ) , "b" . into( ) ] ) ,
851857 }
852858 ) ) ,
@@ -856,8 +862,14 @@ fn test_snowflake_create_table_with_several_column_options() {
856862 option: ColumnOption :: Tags ( TagsColumnOption {
857863 with: true ,
858864 tags: vec![
859- Tag :: new( "A" . into( ) , "TAG A" . into( ) ) ,
860- Tag :: new( "B" . into( ) , "TAG B" . into( ) ) ,
865+ Tag :: new(
866+ ObjectName :: from( vec![ Ident :: new( "A" ) ] ) ,
867+ "TAG A" . into( )
868+ ) ,
869+ Tag :: new(
870+ ObjectName :: from( vec![ Ident :: new( "B" ) ] ) ,
871+ "TAG B" . into( )
872+ ) ,
861873 ]
862874 } ) ,
863875 }
@@ -878,7 +890,7 @@ fn test_snowflake_create_table_with_several_column_options() {
878890 option: ColumnOption :: Policy ( ColumnPolicy :: ProjectionPolicy (
879891 ColumnPolicyProperty {
880892 with: false ,
881- policy_name: "p2" . into ( ) ,
893+ policy_name: ObjectName :: from ( vec! [ Ident :: new ( "p2" ) ] ) ,
882894 using_columns: None ,
883895 }
884896 ) ) ,
@@ -888,8 +900,14 @@ fn test_snowflake_create_table_with_several_column_options() {
888900 option: ColumnOption :: Tags ( TagsColumnOption {
889901 with: false ,
890902 tags: vec![
891- Tag :: new( "C" . into( ) , "TAG C" . into( ) ) ,
892- Tag :: new( "D" . into( ) , "TAG D" . into( ) ) ,
903+ Tag :: new(
904+ ObjectName :: from( vec![ Ident :: new( "C" ) ] ) ,
905+ "TAG C" . into( )
906+ ) ,
907+ Tag :: new(
908+ ObjectName :: from( vec![ Ident :: new( "D" ) ] ) ,
909+ "TAG D" . into( )
910+ ) ,
893911 ]
894912 } ) ,
895913 }
@@ -942,8 +960,8 @@ fn test_snowflake_create_iceberg_table_all_options() {
942960 with_aggregation_policy. map( |name| name. to_string( ) )
943961 ) ;
944962 assert_eq ! ( Some ( vec![
945- Tag :: new( "A" . into ( ) , "TAG A" . into( ) ) ,
946- Tag :: new( "B" . into ( ) , "TAG B" . into( ) ) ,
963+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "A" ) ] ) , "TAG A" . into( ) ) ,
964+ Tag :: new( ObjectName :: from ( vec! [ Ident :: new ( "B" ) ] ) , "TAG B" . into( ) ) ,
947965 ] ) , with_tags) ;
948966
949967 }
@@ -4172,3 +4190,17 @@ fn test_snowflake_create_view_with_multiple_column_options() {
41724190 r#"CREATE VIEW X (COL WITH TAG (pii='email') COMMENT 'foobar') AS SELECT * FROM Y"# ;
41734191 snowflake ( ) . verified_stmt ( create_view_with_tag) ;
41744192}
4193+
4194+ #[ test]
4195+ fn test_snowflake_create_view_with_composite_tag ( ) {
4196+ let create_view_with_tag =
4197+ r#"CREATE VIEW X (COL WITH TAG (foo.bar.baz.pii='email')) AS SELECT * FROM Y"# ;
4198+ snowflake ( ) . verified_stmt ( create_view_with_tag) ;
4199+ }
4200+
4201+ #[ test]
4202+ fn test_snowflake_create_view_with_composite_policy_name ( ) {
4203+ let create_view_with_tag =
4204+ r#"CREATE VIEW X (COL WITH MASKING POLICY foo.bar.baz) AS SELECT * FROM Y"# ;
4205+ snowflake ( ) . verified_stmt ( create_view_with_tag) ;
4206+ }
0 commit comments