Skip to content

Commit 0bf304a

Browse files
committed
fix: review comments
1 parent 4c0766a commit 0bf304a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/iceberg/transform_function.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ Result<Literal> BucketTransform::Transform(const Literal& literal) {
5959
literal.ToString(), source_type()->ToString());
6060
}
6161
if (literal.IsNull()) [[unlikely]] {
62-
return Literal::Null(iceberg::int32());
62+
return Literal::Null(int32());
6363
}
6464

6565
int32_t hash_value = 0;
@@ -95,7 +95,7 @@ Result<Literal> BucketTransform::Transform(const Literal& literal) {
9595
return Literal::Int(bucket_index);
9696
}
9797

98-
std::shared_ptr<Type> BucketTransform::ResultType() const { return iceberg::int32(); }
98+
std::shared_ptr<Type> BucketTransform::ResultType() const { return int32(); }
9999

100100
Result<std::unique_ptr<TransformFunction>> BucketTransform::Make(
101101
std::shared_ptr<Type> const& source_type, int32_t num_buckets) {
@@ -166,7 +166,7 @@ Result<Literal> TruncateTransform::Transform(const Literal& literal) {
166166
if (value.size() > static_cast<size_t>(width_)) {
167167
value.resize(width_);
168168
}
169-
return Literal::Binary(value);
169+
return Literal::Binary(std::move(value));
170170
}
171171
default:
172172
std::unreachable();
@@ -208,7 +208,7 @@ Result<Literal> YearTransform::Transform(const Literal& literal) {
208208
literal.ToString(), source_type()->ToString());
209209
}
210210
if (literal.IsNull()) [[unlikely]] {
211-
return Literal::Null(iceberg::int32());
211+
return Literal::Null(int32());
212212
}
213213

214214
using namespace std::chrono; // NOLINT
@@ -231,7 +231,7 @@ Result<Literal> YearTransform::Transform(const Literal& literal) {
231231
}
232232
}
233233

234-
std::shared_ptr<Type> YearTransform::ResultType() const { return iceberg::int32(); }
234+
std::shared_ptr<Type> YearTransform::ResultType() const { return int32(); }
235235

236236
Result<std::unique_ptr<TransformFunction>> YearTransform::Make(
237237
std::shared_ptr<Type> const& source_type) {
@@ -261,7 +261,7 @@ Result<Literal> MonthTransform::Transform(const Literal& literal) {
261261
literal.ToString(), source_type()->ToString());
262262
}
263263
if (literal.IsNull()) [[unlikely]] {
264-
return Literal::Null(iceberg::int32());
264+
return Literal::Null(int32());
265265
}
266266

267267
using namespace std::chrono; // NOLINT
@@ -296,7 +296,7 @@ Result<Literal> MonthTransform::Transform(const Literal& literal) {
296296
}
297297
}
298298

299-
std::shared_ptr<Type> MonthTransform::ResultType() const { return iceberg::int32(); }
299+
std::shared_ptr<Type> MonthTransform::ResultType() const { return int32(); }
300300

301301
Result<std::unique_ptr<TransformFunction>> MonthTransform::Make(
302302
std::shared_ptr<Type> const& source_type) {
@@ -326,7 +326,7 @@ Result<Literal> DayTransform::Transform(const Literal& literal) {
326326
literal.ToString(), source_type()->ToString());
327327
}
328328
if (literal.IsNull()) [[unlikely]] {
329-
return Literal::Null(iceberg::int32());
329+
return Literal::Null(int32());
330330
}
331331

332332
using namespace std::chrono; // NOLINT
@@ -350,7 +350,7 @@ Result<Literal> DayTransform::Transform(const Literal& literal) {
350350
}
351351
}
352352

353-
std::shared_ptr<Type> DayTransform::ResultType() const { return iceberg::int32(); }
353+
std::shared_ptr<Type> DayTransform::ResultType() const { return int32(); }
354354

355355
Result<std::unique_ptr<TransformFunction>> DayTransform::Make(
356356
std::shared_ptr<Type> const& source_type) {
@@ -402,7 +402,7 @@ Result<Literal> HourTransform::Transform(const Literal& literal) {
402402
}
403403
}
404404

405-
std::shared_ptr<Type> HourTransform::ResultType() const { return iceberg::int32(); }
405+
std::shared_ptr<Type> HourTransform::ResultType() const { return int32(); }
406406

407407
Result<std::unique_ptr<TransformFunction>> HourTransform::Make(
408408
std::shared_ptr<Type> const& source_type) {

src/iceberg/util/truncate_utils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ ICEBERG_EXPORT class TruncateUtils {
3535
/// \return A valid UTF-8 string truncated to L code points.
3636
/// If the input string is already valid and has fewer than L code points, it is
3737
/// returned unchanged.
38-
static std::string TruncateUTF8(std::string&& source, size_t L) {
38+
static std::string TruncateUTF8(std::string source, size_t L) {
3939
size_t code_point_count = 0;
4040
size_t safe_point = 0;
4141

0 commit comments

Comments
 (0)