File tree Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Expand file tree Collapse file tree 3 files changed +15
-0
lines changed Original file line number Diff line number Diff line change 4343#include " iceberg/util/formatter.h" // IWYU pragma: keep
4444#include " iceberg/util/macros.h"
4545#include " iceberg/util/timepoint.h"
46+ #include " iceberg/util/unreachable.h"
4647
4748namespace iceberg {
4849
@@ -476,6 +477,9 @@ nlohmann::json ToJson(const Type& type) {
476477 }
477478 case TypeId::kUuid :
478479 return " uuid" ;
480+ default :
481+ internal::Unreachable (std::format (" Unknown type id: {}" ,
482+ static_cast <int >(type.type_id ())));
479483 }
480484}
481485
Original file line number Diff line number Diff line change 2929#include " iceberg/util/checked_cast.h"
3030#include " iceberg/util/formatter_internal.h"
3131#include " iceberg/util/macros.h"
32+ #include " iceberg/util/unreachable.h"
3233
3334namespace iceberg {
3435
@@ -171,6 +172,9 @@ std::string_view ToString(FieldProjection::Kind kind) {
171172 return " default" ;
172173 case FieldProjection::Kind::kNull :
173174 return " null" ;
175+ default :
176+ internal::Unreachable (std::format (" Unknown field projection kind: {}" ,
177+ static_cast <int >(kind)));
174178 }
175179}
176180
Original file line number Diff line number Diff line change 2424
2525#include " iceberg/transform_function.h"
2626#include " iceberg/type.h"
27+ #include " iceberg/util/unreachable.h"
2728
2829namespace iceberg {
2930namespace {
@@ -58,6 +59,9 @@ constexpr std::string_view TransformTypeToString(TransformType type) {
5859 return kHourName ;
5960 case TransformType::kVoid :
6061 return kVoidName ;
62+ default :
63+ internal::Unreachable (std::format (" Unknown transform type: {}" ,
64+ static_cast <int >(type)));
6165 }
6266}
6367
@@ -165,6 +169,9 @@ std::string Transform::ToString() const {
165169 case TransformType::kTruncate :
166170 return std::format (" {}[{}]" , TransformTypeToString (transform_type_),
167171 std::get<int32_t >(param_));
172+ default :
173+ internal::Unreachable (std::format (" Unknown transform type: {}" ,
174+ static_cast <int >(transform_type_)));
168175 }
169176}
170177
You can’t perform that action at this time.
0 commit comments