@@ -46,20 +46,20 @@ class ICEBERG_EXPORT Type : public iceberg::util::Formattable {
4646 ~Type () override = default ;
4747
4848 // / \brief Get the type ID.
49- [[nodiscard]] virtual TypeId type_id () const = 0;
49+ virtual TypeId type_id () const = 0;
5050
5151 // / \brief Is this a primitive type (may not have child fields)?
52- [[nodiscard]] virtual bool is_primitive () const = 0;
52+ virtual bool is_primitive () const = 0;
5353
5454 // / \brief Is this a nested type (may have child fields)?
55- [[nodiscard]] virtual bool is_nested () const = 0;
55+ virtual bool is_nested () const = 0;
5656
5757 // / \brief Compare two types for equality.
5858 friend bool operator ==(const Type& lhs, const Type& rhs) { return lhs.Equals (rhs); }
5959
6060 protected:
6161 // / \brief Compare two types for equality.
62- [[nodiscard]] virtual bool Equals (const Type& other) const = 0;
62+ virtual bool Equals (const Type& other) const = 0;
6363};
6464
6565// / \brief A data type that does not have child fields.
@@ -76,28 +76,27 @@ class ICEBERG_EXPORT NestedType : public Type {
7676 bool is_nested () const override { return true ; }
7777
7878 // / \brief Get a view of the child fields.
79- [[nodiscard]] virtual std::span<const SchemaField> fields () const = 0;
79+ virtual std::span<const SchemaField> fields () const = 0;
8080 using SchemaFieldConstRef = std::reference_wrapper<const SchemaField>;
8181 // / \brief Get a field by field ID.
8282 // /
8383 // / \note This is O(1) complexity.
84- [[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById (
84+ virtual Result<std::optional<SchemaFieldConstRef>> GetFieldById (
8585 int32_t field_id) const = 0;
8686 // / \brief Get a field by index.
8787 // /
8888 // / \note This is O(1) complexity.
89- [[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex (
89+ virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByIndex (
9090 int32_t index) const = 0;
9191 // / \brief Get a field by name. Return an error Status if
9292 // / the field name is not unique; prefer GetFieldById or GetFieldByIndex
9393 // / when possible.
9494 // /
9595 // / \note This is O(1) complexity.
96- [[nodiscard]] virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName (
96+ virtual Result<std::optional<SchemaFieldConstRef>> GetFieldByName (
9797 std::string_view name, bool case_sensitive) const = 0;
9898 // / \brief Get a field by name (case-sensitive).
99- [[nodiscard]] Result<std::optional<SchemaFieldConstRef>> GetFieldByName (
100- std::string_view name) const ;
99+ Result<std::optional<SchemaFieldConstRef>> GetFieldByName (std::string_view name) const ;
101100};
102101
103102// / \defgroup type-nested Nested Types
@@ -324,10 +323,10 @@ class ICEBERG_EXPORT DecimalType : public PrimitiveType {
324323 ~DecimalType () override = default ;
325324
326325 // / \brief Get the precision (the number of decimal digits).
327- [[nodiscard]] int32_t precision () const ;
326+ int32_t precision () const ;
328327 // / \brief Get the scale (essentially, the number of decimal digits after
329328 // / the decimal point; precisely, the value is scaled by $$10^{-s}$$.).
330- [[nodiscard]] int32_t scale () const ;
329+ int32_t scale () const ;
331330
332331 TypeId type_id () const override ;
333332 std::string ToString () const override ;
@@ -377,9 +376,9 @@ class ICEBERG_EXPORT TimeType : public PrimitiveType {
377376class ICEBERG_EXPORT TimestampBase : public PrimitiveType {
378377 public:
379378 // / \brief Is this type zoned or naive?
380- [[nodiscard]] virtual bool is_zoned () const = 0;
379+ virtual bool is_zoned () const = 0;
381380 // / \brief The time resolution.
382- [[nodiscard]] virtual TimeUnit time_unit () const = 0;
381+ virtual TimeUnit time_unit () const = 0;
383382};
384383
385384// / \brief A data type representing a timestamp in microseconds without
@@ -499,7 +498,7 @@ class ICEBERG_EXPORT FixedType : public PrimitiveType {
499498 ~FixedType () override = default ;
500499
501500 // / \brief The length (the number of bytes to store).
502- [[nodiscard]] int32_t length () const ;
501+ int32_t length () const ;
503502
504503 TypeId type_id () const override ;
505504 std::string ToString () const override ;
@@ -552,7 +551,7 @@ class ICEBERG_EXPORT GeometryType : public PrimitiveType {
552551 explicit GeometryType (std::string crs);
553552 ~GeometryType () override = default ;
554553
555- [[nodiscard]] std::string_view crs () const ;
554+ std::string_view crs () const ;
556555
557556 TypeId type_id () const override ;
558557 std::string ToString () const override ;
@@ -561,7 +560,7 @@ class ICEBERG_EXPORT GeometryType : public PrimitiveType {
561560 bool Equals (const Type& other) const override ;
562561
563562 private:
564- std::optional<std:: string> crs_;
563+ std::string crs_;
565564};
566565
567566// / \brief A data type representing OGC geography in WKB format.
@@ -576,8 +575,8 @@ class ICEBERG_EXPORT GeographyType : public PrimitiveType {
576575 GeographyType (std::string crs, EdgeAlgorithm algorithm);
577576 ~GeographyType () override = default ;
578577
579- [[nodiscard]] std::string_view crs () const ;
580- [[nodiscard]] EdgeAlgorithm algorithm () const ;
578+ std::string_view crs () const ;
579+ EdgeAlgorithm algorithm () const ;
581580
582581 TypeId type_id () const override ;
583582 std::string ToString () const override ;
@@ -586,8 +585,8 @@ class ICEBERG_EXPORT GeographyType : public PrimitiveType {
586585 bool Equals (const Type& other) const override ;
587586
588587 private:
589- std::optional<std:: string> crs_;
590- std::optional< EdgeAlgorithm> algorithm_;
588+ std::string crs_;
589+ EdgeAlgorithm algorithm_ = kDefaultAlgorithm ;
591590};
592591
593592// / @}
0 commit comments