|
18 | 18 | */ |
19 | 19 |
|
20 | 20 | #include "iceberg/datum.h" |
21 | | -#include "iceberg/exception.h" |
22 | 21 |
|
23 | 22 | #include <sstream> |
24 | 23 |
|
| 24 | +#include "iceberg/exception.h" |
| 25 | + |
25 | 26 | namespace iceberg { |
26 | 27 |
|
27 | 28 | // Constructor |
28 | | -PrimitiveLiteral::PrimitiveLiteral(PrimitiveLiteralValue value, std::shared_ptr<PrimitiveType> type) |
| 29 | +PrimitiveLiteral::PrimitiveLiteral(PrimitiveLiteralValue value, |
| 30 | + std::shared_ptr<PrimitiveType> type) |
29 | 31 | : value_(std::move(value)), type_(std::move(type)) {} |
30 | 32 |
|
31 | 33 | // Factory methods |
@@ -66,24 +68,20 @@ Result<std::vector<uint8_t>> PrimitiveLiteral::Serialize() const { |
66 | 68 | } |
67 | 69 |
|
68 | 70 | // Getters |
69 | | -const PrimitiveLiteralValue& PrimitiveLiteral::value() const { |
70 | | - return value_; |
71 | | -} |
| 71 | +const PrimitiveLiteralValue& PrimitiveLiteral::value() const { return value_; } |
72 | 72 |
|
73 | | -const std::shared_ptr<PrimitiveType>& PrimitiveLiteral::type() const { |
74 | | - return type_; |
75 | | -} |
| 73 | +const std::shared_ptr<PrimitiveType>& PrimitiveLiteral::type() const { return type_; } |
76 | 74 |
|
77 | 75 | // Cast method |
78 | | -Result<PrimitiveLiteral> PrimitiveLiteral::CastTo(const std::shared_ptr<PrimitiveType>& target_type) const { |
| 76 | +Result<PrimitiveLiteral> PrimitiveLiteral::CastTo( |
| 77 | + const std::shared_ptr<PrimitiveType>& target_type) const { |
79 | 78 | if (*type_ == *target_type) { |
80 | 79 | // If types are the same, return a copy of the current literal |
81 | 80 | return PrimitiveLiteral(value_, target_type); |
82 | 81 | } |
83 | 82 |
|
84 | | - return NotImplemented("Cast from {} to {} is not implemented", |
85 | | - type_->ToString(), target_type->ToString()); |
86 | | - |
| 83 | + return NotImplemented("Cast from {} to {} is not implemented", type_->ToString(), |
| 84 | + target_type->ToString()); |
87 | 85 | } |
88 | 86 |
|
89 | 87 | // Three-way comparison operator |
|
0 commit comments