Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/iceberg/partition_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ICEBERG_EXPORT PartitionField : public util::Formattable {

private:
/// \brief Compare two fields for equality.
[[nodiscard]] bool Equals(const PartitionField& other) const;
bool Equals(const PartitionField& other) const;

int32_t source_id_;
int32_t field_id_;
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/partition_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class ICEBERG_EXPORT PartitionSpec : public util::Formattable {

private:
/// \brief Compare two partition specs for equality.
[[nodiscard]] bool Equals(const PartitionSpec& other) const;
bool Equals(const PartitionSpec& other) const;

std::shared_ptr<Schema> schema_;
const int32_t spec_id_;
Expand Down
12 changes: 6 additions & 6 deletions src/iceberg/schema_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,29 +56,29 @@ class ICEBERG_EXPORT SchemaField : public iceberg::util::Formattable {
std::shared_ptr<Type> type, std::string doc = {});

/// \brief Get the field ID.
[[nodiscard]] int32_t field_id() const;
int32_t field_id() const;

/// \brief Get the field name.
[[nodiscard]] std::string_view name() const;
std::string_view name() const;

/// \brief Get the field type.
[[nodiscard]] const std::shared_ptr<Type>& type() const;
const std::shared_ptr<Type>& type() const;

/// \brief Get whether the field is optional.
[[nodiscard]] bool optional() const;
bool optional() const;

/// \brief Get the field documentation.
std::string_view doc() const;

[[nodiscard]] std::string ToString() const override;
std::string ToString() const override;

friend bool operator==(const SchemaField& lhs, const SchemaField& rhs) {
return lhs.Equals(rhs);
}

private:
/// \brief Compare two fields for equality.
[[nodiscard]] bool Equals(const SchemaField& other) const;
bool Equals(const SchemaField& other) const;

int32_t field_id_;
std::string name_;
Expand Down
2 changes: 1 addition & 1 deletion src/iceberg/sort_field.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ICEBERG_EXPORT SortField : public util::Formattable {

private:
/// \brief Compare two fields for equality.
[[nodiscard]] bool Equals(const SortField& other) const;
bool Equals(const SortField& other) const;

int32_t source_id_;
std::shared_ptr<Transform> transform_;
Expand Down
4 changes: 2 additions & 2 deletions src/iceberg/transform.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class ICEBERG_EXPORT Transform : public util::Formattable {
Transform(TransformType transform_type, int32_t param);

/// \brief Checks equality with another Transform instance.
[[nodiscard]] virtual bool Equals(const Transform& other) const;
virtual bool Equals(const Transform& other) const;

TransformType transform_type_;
/// Optional parameter (e.g., num_buckets, width)
Expand Down Expand Up @@ -210,7 +210,7 @@ class ICEBERG_EXPORT TransformFunction {

private:
/// \brief Compare two partition specs for equality.
[[nodiscard]] virtual bool Equals(const TransformFunction& other) const;
virtual bool Equals(const TransformFunction& other) const;

TransformType transform_type_;
std::shared_ptr<Type> source_type_;
Expand Down
29 changes: 14 additions & 15 deletions src/iceberg/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ class ICEBERG_EXPORT Type : public iceberg::util::Formattable {
~Type() override = default;

/// \brief Get the type ID.
[[nodiscard]] virtual TypeId type_id() const = 0;
virtual TypeId type_id() const = 0;

/// \brief Is this a primitive type (may not have child fields)?
[[nodiscard]] virtual bool is_primitive() const = 0;
virtual bool is_primitive() const = 0;

/// \brief Is this a nested type (may have child fields)?
[[nodiscard]] virtual bool is_nested() const = 0;
virtual bool is_nested() const = 0;

/// \brief Compare two types for equality.
friend bool operator==(const Type& lhs, const Type& rhs) { return lhs.Equals(rhs); }

protected:
/// \brief Compare two types for equality.
[[nodiscard]] virtual bool Equals(const Type& other) const = 0;
virtual bool Equals(const Type& other) const = 0;
};

/// \brief A data type that does not have child fields.
Expand All @@ -83,28 +83,27 @@ class ICEBERG_EXPORT NestedType : public Type {
bool is_nested() const override { return true; }

/// \brief Get a view of the child fields.
[[nodiscard]] virtual std::span<const SchemaField> fields() const = 0;
virtual std::span<const SchemaField> fields() const = 0;
using SchemaFieldConstRef = std::reference_wrapper<const SchemaField>;
/// \brief Get a field by field ID.
///
/// \note This is O(1) complexity.
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById(
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById(
int32_t field_id) const = 0;
/// \brief Get a field by index.
///
/// \note This is O(1) complexity.
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex(
int32_t index) const = 0;
/// \brief Get a field by name. Return an error Status if
/// the field name is not unique; prefer GetFieldById or GetFieldByIndex
/// when possible.
///
/// \note This is O(1) complexity.
[[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
std::string_view name, bool case_sensitive) const = 0;
/// \brief Get a field by name (case-sensitive).
[[nodiscard]] Result<std::optional<SchemaFieldConstRef>> GetFieldByName(
std::string_view name) const;
Result<std::optional<SchemaFieldConstRef>> GetFieldByName(std::string_view name) const;
};

/// \defgroup type-nested Nested Types
Expand Down Expand Up @@ -305,10 +304,10 @@ class ICEBERG_EXPORT DecimalType : public PrimitiveType {
~DecimalType() override = default;

/// \brief Get the precision (the number of decimal digits).
[[nodiscard]] int32_t precision() const;
int32_t precision() const;
/// \brief Get the scale (essentially, the number of decimal digits after
/// the decimal point; precisely, the value is scaled by $$10^{-s}$$.).
[[nodiscard]] int32_t scale() const;
int32_t scale() const;

TypeId type_id() const override;
std::string ToString() const override;
Expand Down Expand Up @@ -358,9 +357,9 @@ class ICEBERG_EXPORT TimeType : public PrimitiveType {
class ICEBERG_EXPORT TimestampBase : public PrimitiveType {
public:
/// \brief Is this type zoned or naive?
[[nodiscard]] virtual bool is_zoned() const = 0;
virtual bool is_zoned() const = 0;
/// \brief The time resolution.
[[nodiscard]] virtual TimeUnit time_unit() const = 0;
virtual TimeUnit time_unit() const = 0;
};

/// \brief A data type representing a timestamp in microseconds without
Expand Down Expand Up @@ -442,7 +441,7 @@ class ICEBERG_EXPORT FixedType : public PrimitiveType {
~FixedType() override = default;

/// \brief The length (the number of bytes to store).
[[nodiscard]] int32_t length() const;
int32_t length() const;

TypeId type_id() const override;
std::string ToString() const override;
Expand Down
Loading