Skip to content

Commit 082c7e1

Browse files
committed
try to fix lint
1 parent 9355670 commit 082c7e1

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

src/iceberg/datum.cc

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
*/
1919

2020
#include "iceberg/datum.h"
21-
#include "iceberg/exception.h"
2221

2322
#include <sstream>
2423

24+
#include "iceberg/exception.h"
25+
2526
namespace iceberg {
2627

2728
// Constructor
28-
PrimitiveLiteral::PrimitiveLiteral(PrimitiveLiteralValue value, std::shared_ptr<PrimitiveType> type)
29+
PrimitiveLiteral::PrimitiveLiteral(PrimitiveLiteralValue value,
30+
std::shared_ptr<PrimitiveType> type)
2931
: value_(std::move(value)), type_(std::move(type)) {}
3032

3133
// Factory methods
@@ -66,24 +68,20 @@ Result<std::vector<uint8_t>> PrimitiveLiteral::Serialize() const {
6668
}
6769

6870
// Getters
69-
const PrimitiveLiteralValue& PrimitiveLiteral::value() const {
70-
return value_;
71-
}
71+
const PrimitiveLiteralValue& PrimitiveLiteral::value() const { return value_; }
7272

73-
const std::shared_ptr<PrimitiveType>& PrimitiveLiteral::type() const {
74-
return type_;
75-
}
73+
const std::shared_ptr<PrimitiveType>& PrimitiveLiteral::type() const { return type_; }
7674

7775
// 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 {
7978
if (*type_ == *target_type) {
8079
// If types are the same, return a copy of the current literal
8180
return PrimitiveLiteral(value_, target_type);
8281
}
8382

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());
8785
}
8886

8987
// Three-way comparison operator

src/iceberg/datum.h

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
@@ -25,24 +25,26 @@
2525
#include <variant>
2626
#include <vector>
2727

28-
#include "iceberg/type.h"
2928
#include "iceberg/result.h"
29+
#include "iceberg/type.h"
3030

3131
namespace 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.
3738
struct 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.
4648
struct 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.
6264
class 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

Comments
 (0)