@@ -105,7 +105,7 @@ async fn set_test_namespace(catalog: &GlueCatalog, namespace: &NamespaceIdent) -
105105 Ok ( ( ) )
106106}
107107
108- fn set_table_creation ( location : impl ToString , name : impl ToString ) -> Result < TableCreation > {
108+ fn set_table_creation ( name : impl ToString ) -> Result < TableCreation > {
109109 let schema = Schema :: builder ( )
110110 . with_schema_id ( 0 )
111111 . with_fields ( vec ! [
@@ -115,7 +115,6 @@ fn set_table_creation(location: impl ToString, name: impl ToString) -> Result<Ta
115115 . build ( ) ?;
116116
117117 let creation = TableCreation :: builder ( )
118- . location ( location. to_string ( ) )
119118 . name ( name. to_string ( ) )
120119 . properties ( HashMap :: new ( ) )
121120 . schema ( schema)
@@ -127,7 +126,7 @@ fn set_table_creation(location: impl ToString, name: impl ToString) -> Result<Ta
127126#[ tokio:: test]
128127async fn test_rename_table ( ) -> Result < ( ) > {
129128 let catalog = get_catalog ( ) . await ;
130- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
129+ let creation = set_table_creation ( "my_table" ) ?;
131130 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_rename_table" . into ( ) ) ) ;
132131
133132 catalog
@@ -154,7 +153,7 @@ async fn test_rename_table() -> Result<()> {
154153#[ tokio:: test]
155154async fn test_table_exists ( ) -> Result < ( ) > {
156155 let catalog = get_catalog ( ) . await ;
157- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
156+ let creation = set_table_creation ( "my_table" ) ?;
158157 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_table_exists" . into ( ) ) ) ;
159158
160159 catalog
@@ -178,7 +177,7 @@ async fn test_table_exists() -> Result<()> {
178177#[ tokio:: test]
179178async fn test_drop_table ( ) -> Result < ( ) > {
180179 let catalog = get_catalog ( ) . await ;
181- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
180+ let creation = set_table_creation ( "my_table" ) ?;
182181 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_drop_table" . into ( ) ) ) ;
183182
184183 catalog
@@ -199,7 +198,7 @@ async fn test_drop_table() -> Result<()> {
199198#[ tokio:: test]
200199async fn test_load_table ( ) -> Result < ( ) > {
201200 let catalog = get_catalog ( ) . await ;
202- let creation = set_table_creation ( "s3a://warehouse/hive" , " my_table") ?;
201+ let creation = set_table_creation ( "my_table" ) ?;
203202 let namespace = Namespace :: new ( NamespaceIdent :: new ( "test_load_table" . into ( ) ) ) ;
204203
205204 catalog
@@ -227,7 +226,9 @@ async fn test_create_table() -> Result<()> {
227226 let catalog = get_catalog ( ) . await ;
228227 let namespace = NamespaceIdent :: new ( "test_create_table" . to_string ( ) ) ;
229228 set_test_namespace ( & catalog, & namespace) . await ?;
230- let creation = set_table_creation ( "s3a://warehouse/hive" , "my_table" ) ?;
229+ let mut creation = set_table_creation ( "my_table" ) ?;
230+ // inject custom location, ignore the namespace prefix
231+ creation. location = Some ( "s3a://warehouse/hive" . to_string ( ) ) ;
231232
232233 let result = catalog. create_table ( & namespace, creation) . await ?;
233234
0 commit comments