fresh-borzoni commented on code in PR #611:
URL: https://github.com/apache/fluss-rust/pull/611#discussion_r3384186040


##########
bindings/cpp/src/admin.cpp:
##########
@@ -58,8 +60,37 @@ Result Admin::CreateTable(const TablePath& table_path, const 
TableDescriptor& de
     }
 
     auto ffi_path = utils::to_ffi_table_path(table_path);
-    auto ffi_desc = utils::to_ffi_table_descriptor(descriptor);
 
+    // A MAP/ROW column can't go through the flat FFI encoding, so the schema 
is
+    // sent over Arrow instead (explicit via FromArrow, or lowered from native
+    // columns). Rust derives the columns from it, so the flat columns are 
dropped
+    // here; primary keys / metadata still come from the descriptor.
+    std::shared_ptr<arrow::Schema> arrow_schema = 
descriptor.schema.arrow_schema;
+    if (!arrow_schema) {
+        for (const auto& col : descriptor.schema.columns) {
+            if (detail::is_compound(col.data_type)) {
+                arrow_schema = 
detail::columns_to_arrow_schema(descriptor.schema.columns);
+                break;

Review Comment:
   it's just a detection loop here, "is any datatype is complex/nested here in 
schema?", once the answer is -yes, we can short-circuit. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to