This is an automated email from the ASF dual-hosted git repository.

gangwu pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/iceberg-cpp.git


The following commit(s) were added to refs/heads/main by this push:
     new e2cf82f7 fix: properly propagate errors in MetricsConfig validation 
(#465)
e2cf82f7 is described below

commit e2cf82f735a7534faa35d62c1266dc25dd8a337e
Author: Xinli Shang <[email protected]>
AuthorDate: Tue Dec 30 19:03:08 2025 -0800

    fix: properly propagate errors in MetricsConfig validation (#465)
---
 src/iceberg/metrics_config.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/iceberg/metrics_config.cc b/src/iceberg/metrics_config.cc
index 499a425d..f78cadf2 100644
--- a/src/iceberg/metrics_config.cc
+++ b/src/iceberg/metrics_config.cc
@@ -36,8 +36,8 @@ Status MetricsConfig::VerifyReferencedColumns(
     }
     auto field_name =
         
std::string_view(key).substr(TableProperties::kMetricModeColumnConfPrefix.size());
-    auto field = schema.FindFieldByName(field_name);
-    if (!field.has_value() || !field.value().has_value()) {
+    ICEBERG_ASSIGN_OR_RAISE(auto field, schema.FindFieldByName(field_name));
+    if (!field.has_value()) {
       return ValidationFailed(
           "Invalid metrics config, could not find column {} from table prop {} 
in "
           "schema {}",

Reply via email to