|
21 | 21 |
|
22 | 22 | #include <cmath> |
23 | 23 | #include <concepts> |
24 | | -#include <sstream> |
25 | 24 |
|
26 | 25 | #include "iceberg/exception.h" |
27 | 26 |
|
@@ -126,33 +125,28 @@ Literal::Literal(Value value, std::shared_ptr<PrimitiveType> type) |
126 | 125 | : value_(std::move(value)), type_(std::move(type)) {} |
127 | 126 |
|
128 | 127 | // Factory methods |
| 128 | +Literal Literal::Boolean(bool value) { return {Value{value}, boolean()}; } |
129 | 129 |
|
130 | | -Literal Literal::Boolean(bool value) { return {Value{value}, iceberg::boolean()}; } |
| 130 | +Literal Literal::Int(int32_t value) { return {Value{value}, int32()}; } |
131 | 131 |
|
132 | | -Literal Literal::Int(int32_t value) { return {Value{value}, iceberg::int32()}; } |
| 132 | +Literal Literal::Date(int32_t value) { return {Value{value}, date()}; } |
133 | 133 |
|
134 | | -Literal Literal::Date(int32_t value) { return {Value{value}, iceberg::date()}; } |
| 134 | +Literal Literal::Long(int64_t value) { return {Value{value}, int64()}; } |
135 | 135 |
|
136 | | -Literal Literal::Long(int64_t value) { return {Value{value}, iceberg::int64()}; } |
| 136 | +Literal Literal::Time(int64_t value) { return {Value{value}, time()}; } |
137 | 137 |
|
138 | | -Literal Literal::Time(int64_t value) { return {Value{value}, iceberg::time()}; } |
| 138 | +Literal Literal::Timestamp(int64_t value) { return {Value{value}, timestamp()}; } |
139 | 139 |
|
140 | | -Literal Literal::Timestamp(int64_t value) { return {Value{value}, iceberg::timestamp()}; } |
| 140 | +Literal Literal::TimestampTz(int64_t value) { return {Value{value}, timestamp_tz()}; } |
141 | 141 |
|
142 | | -Literal Literal::TimestampTz(int64_t value) { |
143 | | - return {Value{value}, iceberg::timestamp_tz()}; |
144 | | -} |
145 | | - |
146 | | -Literal Literal::Float(float value) { return {Value{value}, iceberg::float32()}; } |
| 142 | +Literal Literal::Float(float value) { return {Value{value}, float32()}; } |
147 | 143 |
|
148 | | -Literal Literal::Double(double value) { return {Value{value}, iceberg::float64()}; } |
| 144 | +Literal Literal::Double(double value) { return {Value{value}, float64()}; } |
149 | 145 |
|
150 | | -Literal Literal::String(std::string value) { |
151 | | - return {Value{std::move(value)}, iceberg::string()}; |
152 | | -} |
| 146 | +Literal Literal::String(std::string value) { return {Value{std::move(value)}, string()}; } |
153 | 147 |
|
154 | 148 | Literal Literal::Binary(std::vector<uint8_t> value) { |
155 | | - return {Value{std::move(value)}, iceberg::binary()}; |
| 149 | + return {Value{std::move(value)}, binary()}; |
156 | 150 | } |
157 | 151 |
|
158 | 152 | Result<Literal> Literal::Deserialize(std::span<const uint8_t> data, |
|
0 commit comments