File tree Expand file tree Collapse file tree 3 files changed +11
-0
lines changed Expand file tree Collapse file tree 3 files changed +11
-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
@@ -477,6 +478,8 @@ nlohmann::json ToJson(const Type& type) {
477478 case TypeId::kUuid :
478479 return " uuid" ;
479480 }
481+ internal::Unreachable (
482+ std::format (" Unknown type id: {}" , static_cast <int >(type.type_id ())));
480483}
481484
482485nlohmann::json ToJson (const Schema& schema) {
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
@@ -172,6 +173,8 @@ std::string_view ToString(FieldProjection::Kind kind) {
172173 case FieldProjection::Kind::kNull :
173174 return " null" ;
174175 }
176+ internal::Unreachable (
177+ std::format (" Unknown field projection kind: {}" , static_cast <int >(kind)));
175178}
176179
177180std::string ToString (const FieldProjection& projection) {
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 {
@@ -59,6 +60,8 @@ constexpr std::string_view TransformTypeToString(TransformType type) {
5960 case TransformType::kVoid :
6061 return kVoidName ;
6162 }
63+ internal::Unreachable (
64+ std::format (" Unknown transform type: {}" , static_cast <int >(type)));
6265}
6366
6467std::shared_ptr<Transform> Transform::Identity () {
@@ -166,6 +169,8 @@ std::string Transform::ToString() const {
166169 return std::format (" {}[{}]" , TransformTypeToString (transform_type_),
167170 std::get<int32_t >(param_));
168171 }
172+ internal::Unreachable (
173+ std::format (" Unknown transform type: {}" , static_cast <int >(transform_type_)));
169174}
170175
171176TransformFunction::TransformFunction (TransformType transform_type,
You can’t perform that action at this time.
0 commit comments