morningman commented on code in PR #58396:
URL: https://github.com/apache/doris/pull/58396#discussion_r2587466962


##########
be/src/vec/sink/writer/iceberg/viceberg_table_writer.cpp:
##########
@@ -116,6 +121,62 @@ VIcebergTableWriter::_to_iceberg_partition_columns() {
     return partition_columns;
 }
 
+void VIcebergTableWriter::_init_static_partition_values() {
+    auto& iceberg_sink = _t_sink.iceberg_table_sink;
+    if (!iceberg_sink.__isset.static_partition_values ||
+        iceberg_sink.static_partition_values.empty()) {
+        _has_static_partition = false;
+        _is_full_static_partition = false;
+        return;
+    }
+
+    _has_static_partition = true;
+    const auto& static_values_map = iceberg_sink.static_partition_values;
+
+    size_t num_cols = _iceberg_partition_columns.size();
+    _partition_column_static_values.resize(num_cols);
+    _partition_column_is_static.assign(num_cols, 0);
+
+    size_t dynamic_count = 0;
+    for (size_t i = 0; i < num_cols; ++i) {
+        const std::string& col_name = 
_iceberg_partition_columns[i].field().name();
+        auto it = static_values_map.find(col_name);
+        if (it != static_values_map.end()) {
+            _partition_column_static_values[i] = it->second;
+            _partition_column_is_static[i] = 1;
+        } else {
+            dynamic_count++;
+        }
+    }
+
+    // Check if all partition columns are statically specified
+    _is_full_static_partition = (dynamic_count == 0);
+
+    // Build static partition path prefix
+    _static_partition_path = _build_static_partition_path();
+
+    // For full static mode, build complete partition value list
+    if (_is_full_static_partition) {
+        _static_partition_value_list = _partition_column_static_values;
+    }
+}
+
+std::string VIcebergTableWriter::_build_static_partition_path() {

Review Comment:
   Add comment for this method, give an example



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to