@@ -101,6 +101,8 @@ pub enum TaggableObject {
101101 Table { table_id : u64 } ,
102102 Stage { name : String } ,
103103 Connection { name : String } ,
104+ UDF { name : String } ,
105+ Procedure { name : String , args : String } ,
104106}
105107
106108impl std:: fmt:: Display for TaggableObject {
@@ -110,6 +112,10 @@ impl std::fmt::Display for TaggableObject {
110112 TaggableObject :: Table { table_id } => write ! ( f, "table(id={})" , table_id) ,
111113 TaggableObject :: Stage { name } => write ! ( f, "stage({})" , name) ,
112114 TaggableObject :: Connection { name } => write ! ( f, "connection({})" , name) ,
115+ TaggableObject :: UDF { name } => write ! ( f, "udf({})" , name) ,
116+ TaggableObject :: Procedure { name, args } => {
117+ write ! ( f, "procedure({}({}))" , name, args)
118+ }
113119 }
114120 }
115121}
@@ -121,6 +127,8 @@ impl TaggableObject {
121127 TaggableObject :: Table { .. } => "table" ,
122128 TaggableObject :: Stage { .. } => "stage" ,
123129 TaggableObject :: Connection { .. } => "connection" ,
130+ TaggableObject :: UDF { .. } => "udf" ,
131+ TaggableObject :: Procedure { .. } => "procedure" ,
124132 }
125133 }
126134
@@ -131,6 +139,8 @@ impl TaggableObject {
131139 TaggableObject :: Table { table_id } => b. push_u64 ( * table_id) ,
132140 TaggableObject :: Stage { name } => b. push_str ( name) ,
133141 TaggableObject :: Connection { name } => b. push_str ( name) ,
142+ TaggableObject :: UDF { name } => b. push_str ( name) ,
143+ TaggableObject :: Procedure { name, args } => b. push_str ( name) . push_str ( args) ,
134144 }
135145 }
136146
@@ -149,9 +159,16 @@ impl TaggableObject {
149159 "connection" => Ok ( TaggableObject :: Connection {
150160 name : parser. next_str ( ) ?,
151161 } ) ,
162+ "udf" => Ok ( TaggableObject :: UDF {
163+ name : parser. next_str ( ) ?,
164+ } ) ,
165+ "procedure" => Ok ( TaggableObject :: Procedure {
166+ name : parser. next_str ( ) ?,
167+ args : parser. next_str ( ) ?,
168+ } ) ,
152169 _ => Err ( KeyError :: InvalidSegment {
153170 i : parser. index ( ) ,
154- expect : "database|table|stage|connection" . to_string ( ) ,
171+ expect : "database|table|stage|connection|udf|procedure " . to_string ( ) ,
155172 got : type_str. to_string ( ) ,
156173 } ) ,
157174 }
0 commit comments