liurenjie1024 commented on code in PR #97:
URL: https://github.com/apache/iceberg-rust/pull/97#discussion_r1399952745


##########
crates/catalog/rest/src/catalog.rs:
##########
@@ -1092,4 +1184,375 @@ mod tests {
         config_mock.assert_async().await;
         rename_table_mock.assert_async().await;
     }
+
+    #[tokio::test]
+    async fn test_create_table() {
+        let mut server = Server::new_async().await;
+
+        let config_mock = create_config_mock(&mut server).await;
+
+        let create_table_mock = server
+            .mock("POST", "/v1/namespaces/ns1/tables")
+            .with_status(200)
+            .with_body_from_file(format!(
+                "{}/testdata/{}",
+                env!("CARGO_MANIFEST_DIR"),
+                "create_table_response.json"
+            ))
+            .create_async()
+            .await;
+
+        let catalog = 
RestCatalog::new(RestCatalogConfig::builder().uri(server.url()).build())
+            .await
+            .unwrap();
+
+        let table_creation = TableCreation::builder()
+            .name("test1".to_string())
+            .schema(
+                Schema::builder()
+                    .with_fields(vec![
+                        NestedField::optional(1, "foo", 
Type::Primitive(PrimitiveType::String))
+                            .into(),
+                        NestedField::required(2, "bar", 
Type::Primitive(PrimitiveType::Int)).into(),
+                        NestedField::optional(3, "baz", 
Type::Primitive(PrimitiveType::Boolean))
+                            .into(),
+                    ])
+                    .with_schema_id(1)
+                    .with_identifier_field_ids(vec![2])
+                    .build()
+                    .unwrap(),
+            )
+            .properties(HashMap::from([("owner".to_string(), 
"testx".to_string())]))
+            .partition_spec(
+                PartitionSpec::builder()
+                    .with_fields(vec![PartitionField::builder()
+                        .source_id(1)
+                        .field_id(1000)

Review Comment:
   Yes, it should use `UnboundSortOrder` and `UnboundPartitionSpec`. They will 
be fixed after https://github.com/apache/iceberg-rust/issues/99
   https://github.com/apache/iceberg-rust/issues/98



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to