Skip to content

Commit 3511cdf

Browse files
committed
use type factory method as returned type
1 parent 6d4ffa1 commit 3511cdf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/iceberg/transform_function.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Result<std::shared_ptr<Type>> BucketTransform::ResultType() const {
6464
case TypeId::kUuid:
6565
case TypeId::kFixed:
6666
case TypeId::kBinary:
67-
return std::make_shared<IntType>();
67+
return iceberg::int32();
6868
default:
6969
return NotSupported("{} is not a valid input type for bucket transform",
7070
src_type->ToString());
@@ -113,7 +113,7 @@ Result<std::shared_ptr<Type>> YearTransform::ResultType() const {
113113
case TypeId::kDate:
114114
case TypeId::kTimestamp:
115115
case TypeId::kTimestampTz:
116-
return std::make_shared<IntType>();
116+
return iceberg::int32();
117117
default:
118118
return NotSupported("{} is not a valid input type for year transform",
119119
src_type->ToString());
@@ -136,7 +136,7 @@ Result<std::shared_ptr<Type>> MonthTransform::ResultType() const {
136136
case TypeId::kDate:
137137
case TypeId::kTimestamp:
138138
case TypeId::kTimestampTz:
139-
return std::make_shared<IntType>();
139+
return iceberg::int32();
140140
default:
141141
return NotSupported("{} is not a valid input type for month transform",
142142
src_type->ToString());
@@ -159,7 +159,7 @@ Result<std::shared_ptr<Type>> DayTransform::ResultType() const {
159159
case TypeId::kDate:
160160
case TypeId::kTimestamp:
161161
case TypeId::kTimestampTz:
162-
return std::make_shared<DateType>();
162+
return iceberg::date();
163163
default:
164164
return NotSupported("{} is not a valid input type for day transform",
165165
src_type->ToString());
@@ -181,7 +181,7 @@ Result<std::shared_ptr<Type>> HourTransform::ResultType() const {
181181
switch (src_type->type_id()) {
182182
case TypeId::kTimestamp:
183183
case TypeId::kTimestampTz:
184-
return std::make_shared<IntType>();
184+
return iceberg::int32();
185185
default:
186186
return NotSupported("{} is not a valid input type for hour transform",
187187
src_type->ToString());

0 commit comments

Comments
 (0)