@@ -41,7 +41,7 @@ StructType::StructType(std::vector<SchemaField> fields) : fields_(std::move(fiel
4141 }
4242}
4343
44- TypeId StructType::type_id () const { return TypeId:: kStruct ; }
44+ TypeId StructType::type_id () const { return kTypeId ; }
4545std::string StructType::ToString () const {
4646 std::string repr = " struct<\n " ;
4747 for (const auto & field : fields_) {
@@ -93,7 +93,7 @@ ListType::ListType(SchemaField element) : element_(std::move(element)) {
9393ListType::ListType (int32_t field_id, std::shared_ptr<Type> type, bool optional)
9494 : element_(field_id, std::string(kElementName ), std::move(type), optional) {}
9595
96- TypeId ListType::type_id () const { return TypeId:: kList ; }
96+ TypeId ListType::type_id () const { return kTypeId ; }
9797std::string ListType::ToString () const {
9898 // XXX: work around Clang/libc++: "<{}>" in a format string appears to get
9999 // parsed as {<>} or something; split up the format string to avoid that
@@ -146,7 +146,7 @@ MapType::MapType(SchemaField key, SchemaField value)
146146
147147const SchemaField& MapType::key () const { return fields_[0 ]; }
148148const SchemaField& MapType::value () const { return fields_[1 ]; }
149- TypeId MapType::type_id () const { return TypeId:: kMap ; }
149+ TypeId MapType::type_id () const { return kTypeId ; }
150150std::string MapType::ToString () const {
151151 // XXX: work around Clang/libc++: "<{}>" in a format string appears to get
152152 // parsed as {<>} or something; split up the format string to avoid that
@@ -192,33 +192,25 @@ bool MapType::Equals(const Type& other) const {
192192 return fields_ == map.fields_ ;
193193}
194194
195- TypeId BooleanType::type_id () const { return TypeId:: kBoolean ; }
195+ TypeId BooleanType::type_id () const { return kTypeId ; }
196196std::string BooleanType::ToString () const { return " boolean" ; }
197- bool BooleanType::Equals (const Type& other) const {
198- return other.type_id () == TypeId::kBoolean ;
199- }
197+ bool BooleanType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
200198
201- TypeId IntType::type_id () const { return TypeId:: kInt ; }
199+ TypeId IntType::type_id () const { return kTypeId ; }
202200std::string IntType::ToString () const { return " int" ; }
203- bool IntType::Equals (const Type& other) const { return other.type_id () == TypeId:: kInt ; }
201+ bool IntType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
204202
205- TypeId LongType::type_id () const { return TypeId:: kLong ; }
203+ TypeId LongType::type_id () const { return kTypeId ; }
206204std::string LongType::ToString () const { return " long" ; }
207- bool LongType::Equals (const Type& other) const {
208- return other.type_id () == TypeId::kLong ;
209- }
205+ bool LongType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
210206
211- TypeId FloatType::type_id () const { return TypeId:: kFloat ; }
207+ TypeId FloatType::type_id () const { return kTypeId ; }
212208std::string FloatType::ToString () const { return " float" ; }
213- bool FloatType::Equals (const Type& other) const {
214- return other.type_id () == TypeId::kFloat ;
215- }
209+ bool FloatType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
216210
217- TypeId DoubleType::type_id () const { return TypeId:: kDouble ; }
211+ TypeId DoubleType::type_id () const { return kTypeId ; }
218212std::string DoubleType::ToString () const { return " double" ; }
219- bool DoubleType::Equals (const Type& other) const {
220- return other.type_id () == TypeId::kDouble ;
221- }
213+ bool DoubleType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
222214
223215DecimalType::DecimalType (int32_t precision, int32_t scale)
224216 : precision_(precision), scale_(scale) {
@@ -230,57 +222,47 @@ DecimalType::DecimalType(int32_t precision, int32_t scale)
230222
231223int32_t DecimalType::precision () const { return precision_; }
232224int32_t DecimalType::scale () const { return scale_; }
233- TypeId DecimalType::type_id () const { return TypeId:: kDecimal ; }
225+ TypeId DecimalType::type_id () const { return kTypeId ; }
234226std::string DecimalType::ToString () const {
235227 return std::format (" decimal({}, {})" , precision_, scale_);
236228}
237229bool DecimalType::Equals (const Type& other) const {
238- if (other.type_id () != TypeId:: kDecimal ) {
230+ if (other.type_id () != kTypeId ) {
239231 return false ;
240232 }
241233 const auto & decimal = static_cast <const DecimalType&>(other);
242234 return precision_ == decimal.precision_ && scale_ == decimal.scale_ ;
243235}
244236
245- TypeId DateType::type_id () const { return TypeId:: kDate ; }
237+ TypeId DateType::type_id () const { return kTypeId ; }
246238std::string DateType::ToString () const { return " date" ; }
247- bool DateType::Equals (const Type& other) const {
248- return other.type_id () == TypeId::kDate ;
249- }
239+ bool DateType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
250240
251- TypeId TimeType::type_id () const { return TypeId:: kTime ; }
241+ TypeId TimeType::type_id () const { return kTypeId ; }
252242std::string TimeType::ToString () const { return " time" ; }
253- bool TimeType::Equals (const Type& other) const {
254- return other.type_id () == TypeId::kTime ;
255- }
243+ bool TimeType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
256244
257245bool TimestampType::is_zoned () const { return false ; }
258246TimeUnit TimestampType::time_unit () const { return TimeUnit::kMicrosecond ; }
259- TypeId TimestampType::type_id () const { return TypeId:: kTimestamp ; }
247+ TypeId TimestampType::type_id () const { return kTypeId ; }
260248std::string TimestampType::ToString () const { return " timestamp" ; }
261- bool TimestampType::Equals (const Type& other) const {
262- return other.type_id () == TypeId::kTimestamp ;
263- }
249+ bool TimestampType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
264250
265251bool TimestampTzType::is_zoned () const { return true ; }
266252TimeUnit TimestampTzType::time_unit () const { return TimeUnit::kMicrosecond ; }
267- TypeId TimestampTzType::type_id () const { return TypeId:: kTimestampTz ; }
253+ TypeId TimestampTzType::type_id () const { return kTypeId ; }
268254std::string TimestampTzType::ToString () const { return " timestamptz" ; }
269255bool TimestampTzType::Equals (const Type& other) const {
270- return other.type_id () == TypeId:: kTimestampTz ;
256+ return other.type_id () == kTypeId ;
271257}
272258
273- TypeId StringType::type_id () const { return TypeId:: kString ; }
259+ TypeId StringType::type_id () const { return kTypeId ; }
274260std::string StringType::ToString () const { return " string" ; }
275- bool StringType::Equals (const Type& other) const {
276- return other.type_id () == TypeId::kString ;
277- }
261+ bool StringType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
278262
279- TypeId UuidType::type_id () const { return TypeId:: kUuid ; }
263+ TypeId UuidType::type_id () const { return kTypeId ; }
280264std::string UuidType::ToString () const { return " uuid" ; }
281- bool UuidType::Equals (const Type& other) const {
282- return other.type_id () == TypeId::kUuid ;
283- }
265+ bool UuidType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
284266
285267FixedType::FixedType (int32_t length) : length_(length) {
286268 if (length < 0 ) {
@@ -289,20 +271,18 @@ FixedType::FixedType(int32_t length) : length_(length) {
289271}
290272
291273int32_t FixedType::length () const { return length_; }
292- TypeId FixedType::type_id () const { return TypeId:: kFixed ; }
274+ TypeId FixedType::type_id () const { return kTypeId ; }
293275std::string FixedType::ToString () const { return std::format (" fixed({})" , length_); }
294276bool FixedType::Equals (const Type& other) const {
295- if (other.type_id () != TypeId:: kFixed ) {
277+ if (other.type_id () != kTypeId ) {
296278 return false ;
297279 }
298280 const auto & fixed = static_cast <const FixedType&>(other);
299281 return length_ == fixed.length_ ;
300282}
301283
302- TypeId BinaryType::type_id () const { return TypeId:: kBinary ; }
284+ TypeId BinaryType::type_id () const { return kTypeId ; }
303285std::string BinaryType::ToString () const { return " binary" ; }
304- bool BinaryType::Equals (const Type& other) const {
305- return other.type_id () == TypeId::kBinary ;
306- }
286+ bool BinaryType::Equals (const Type& other) const { return other.type_id () == kTypeId ; }
307287
308288} // namespace iceberg
0 commit comments