@@ -101,7 +101,7 @@ async fn set_test_namespace(catalog: &HmsCatalog, namespace: &NamespaceIdent) ->
101101 Ok ( ( ) )
102102}
103103
104- fn set_table_creation ( location : impl ToString , name : impl ToString ) -> Result < TableCreation > {
104+ fn set_table_creation ( name : impl ToString ) -> Result < TableCreation > {
105105 let schema = Schema :: builder ( )
106106 . with_schema_id ( 0 )
107107 . with_fields ( vec ! [
@@ -111,7 +111,6 @@ fn set_table_creation(location: impl ToString, name: impl ToString) -> Result<Ta
111111 . build ( ) ?;
112112
113113 let creation = TableCreation :: builder ( )
114- . location ( location. to_string ( ) )
115114 . name ( name. to_string ( ) )
116115 . properties ( HashMap :: new ( ) )
117116 . schema ( schema)
@@ -123,7 +122,7 @@ fn set_table_creation(location: impl ToString, name: impl ToString) -> Result<Ta
123122#[ tokio:: test]
124123async fn test_rename_table ( ) -> Result < ( ) > {
125124 let catalog = get_catalog ( ) . await ;
126- let creation: TableCreation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
125+ let creation: TableCreation = set_table_creation ( "my_table" ) ?;
127126 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_rename_table" . into ( ) ) ) ;
128127 set_test_namespace ( & catalog, namespace. name ( ) ) . await ?;
129128
@@ -143,7 +142,7 @@ async fn test_rename_table() -> Result<()> {
143142#[ tokio:: test]
144143async fn test_table_exists ( ) -> Result < ( ) > {
145144 let catalog = get_catalog ( ) . await ;
146- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
145+ let creation = set_table_creation ( "my_table" ) ?;
147146 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_table_exists" . into ( ) ) ) ;
148147 set_test_namespace ( & catalog, namespace. name ( ) ) . await ?;
149148
@@ -159,7 +158,7 @@ async fn test_table_exists() -> Result<()> {
159158#[ tokio:: test]
160159async fn test_drop_table ( ) -> Result < ( ) > {
161160 let catalog = get_catalog ( ) . await ;
162- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
161+ let creation = set_table_creation ( "my_table" ) ?;
163162 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_drop_table" . into ( ) ) ) ;
164163 set_test_namespace ( & catalog, namespace. name ( ) ) . await ?;
165164
@@ -177,7 +176,7 @@ async fn test_drop_table() -> Result<()> {
177176#[ tokio:: test]
178177async fn test_load_table ( ) -> Result < ( ) > {
179178 let catalog = get_catalog ( ) . await ;
180- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
179+ let creation = set_table_creation ( "my_table" ) ?;
181180 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_load_table" . into ( ) ) ) ;
182181 set_test_namespace ( & catalog, namespace. name ( ) ) . await ?;
183182
@@ -200,7 +199,9 @@ async fn test_load_table() -> Result<()> {
200199#[ tokio:: test]
201200async fn test_create_table ( ) -> Result < ( ) > {
202201 let catalog = get_catalog ( ) . await ;
203- let creation = set_table_creation ( "s3a://warehouse/hive" , "my_table" ) ?;
202+ let mut creation = set_table_creation ( "my_table" ) ?;
203+ // inject custom location, ignore the namespace prefix
204+ creation. location = Some ( "s3a://warehouse/hive" . to_string ( ) ) ;
204205 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_create_table" . into ( ) ) ) ;
205206 set_test_namespace ( & catalog, namespace. name ( ) ) . await ?;
206207
@@ -229,7 +230,7 @@ async fn test_list_tables() -> Result<()> {
229230
230231 assert_eq ! ( result, vec![ ] ) ;
231232
232- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
233+ let creation = set_table_creation ( "my_table" ) ?;
233234 catalog. create_table ( ns. name ( ) , creation) . await ?;
234235 let result = catalog. list_tables ( ns. name ( ) ) . await ?;
235236
0 commit comments