11/*
2- * Licensed to the Apache Software Foundation (ASF) under one
2+ * Licensed to the Apache Software Foundation (ASF) under one
33 * or more contributor license agreements. See the NOTICE file
44 * distributed with this work for additional information
55 * regarding copyright ownership. The ASF licenses this file
2525#include < variant>
2626#include < vector>
2727
28- #include " iceberg/type.h"
2928#include " iceberg/result.h"
29+ #include " iceberg/type.h"
3030
3131namespace iceberg {
3232
33- // / \brief Exception type for values that are below the minimum allowed value for a primitive type.
33+ // / \brief Exception type for values that are below the minimum allowed value for a
34+ // / primitive type.
3435// /
35- // / When casting a value to a narrow primitive type, if the value exceeds the maximum of dest type,
36- // / it might be above the maximum allowed value for that type.
36+ // / When casting a value to a narrow primitive type, if the value exceeds the maximum of
37+ // / dest type, it might be above the maximum allowed value for that type.
3738struct BelowMin {
3839 bool operator ==(const BelowMin&) const = default ;
3940 std::strong_ordering operator <=>(const BelowMin&) const = default ;
4041};
4142
42- // / \brief Exception type for values that are above the maximum allowed value for a primitive type.
43+ // / \brief Exception type for values that are above the maximum allowed value for a
44+ // / primitive type.
4345// /
44- // / When casting a value to a narrow primitive type, if the value exceeds the maximum of dest type,
45- // / it might be above the maximum allowed value for that type.
46+ // / When casting a value to a narrow primitive type, if the value exceeds the maximum of
47+ // / dest type, it might be above the maximum allowed value for that type.
4648struct AboveMax {
4749 bool operator ==(const AboveMax&) const = default ;
4850 std::strong_ordering operator <=>(const AboveMax&) const = default ;
@@ -61,7 +63,8 @@ using PrimitiveLiteralValue =
6163// / \brief PrimitiveLiteral is owned literal of a primitive type.
6264class PrimitiveLiteral {
6365 public:
64- explicit PrimitiveLiteral (PrimitiveLiteralValue value, std::shared_ptr<PrimitiveType> type);
66+ explicit PrimitiveLiteral (PrimitiveLiteralValue value,
67+ std::shared_ptr<PrimitiveType> type);
6568
6669 // Factory methods for primitive types
6770 static PrimitiveLiteral Boolean (bool value);
@@ -74,11 +77,13 @@ class PrimitiveLiteral {
7477
7578 // / Create iceberg value from bytes.
7679 // /
77- // / See [this spec](https://iceberg.apache.org/spec/#binary-single-value-serialization) for reference.
80+ // / See [this spec](https://iceberg.apache.org/spec/#binary-single-value-serialization)
81+ // / for reference.
7882 static Result<PrimitiveLiteral> Deserialize (std::span<const uint8_t > data);
7983 // / Serialize iceberg value to bytes.
8084 // /
81- // / See [this spec](https://iceberg.apache.org/spec/#binary-single-value-serialization) for reference.
85+ // / See [this spec](https://iceberg.apache.org/spec/#binary-single-value-serialization)
86+ // / for reference.
8287 Result<std::vector<uint8_t >> Serialize () const ;
8388
8489 // / Get the value as a variant
@@ -88,7 +93,8 @@ class PrimitiveLiteral {
8893 const std::shared_ptr<PrimitiveType>& type () const ;
8994
9095 // / Cast the literal to a specific type
91- Result<PrimitiveLiteral> CastTo (const std::shared_ptr<PrimitiveType>& target_type) const ;
96+ Result<PrimitiveLiteral> CastTo (
97+ const std::shared_ptr<PrimitiveType>& target_type) const ;
9298
9399 std::partial_ordering operator <=>(const PrimitiveLiteral& other) const ;
94100
@@ -100,4 +106,3 @@ class PrimitiveLiteral {
100106};
101107
102108} // namespace iceberg
103-
0 commit comments