lidavidm commented on code in PR #61:
URL: https://github.com/apache/iceberg-cpp/pull/61#discussion_r2036584089


##########
src/iceberg/transform.cc:
##########
@@ -21,55 +21,26 @@
 
 #include <format>
 
-namespace iceberg {
+#include "iceberg/type.h"
 
-namespace {
-/// \brief Get the relative transform name
-constexpr std::string_view ToString(TransformType type) {
-  switch (type) {
-    case TransformType::kUnknown:
-      return "unknown";
-    case TransformType::kIdentity:
-      return "identity";
-    case TransformType::kBucket:
-      return "bucket";
-    case TransformType::kTruncate:
-      return "truncate";
-    case TransformType::kYear:
-      return "year";
-    case TransformType::kMonth:
-      return "month";
-    case TransformType::kDay:
-      return "day";
-    case TransformType::kHour:
-      return "hour";
-    case TransformType::kVoid:
-      return "void";
-    default:
-      return "invalid";
-  }
-}
-}  // namespace
+namespace iceberg {
 
-TransformFunction::TransformFunction(TransformType type) : 
transform_type_(type) {}
+TransformFunction::TransformFunction(TransformType transform_type,
+                                     std::shared_ptr<Type> source_type)
+    : transform_type_(transform_type), source_type_(std::move(source_type)) {}
 
 TransformType TransformFunction::transform_type() const { return 
transform_type_; }
 
-std::string TransformFunction::ToString() const {
-  return std::format("{}", iceberg::ToString(transform_type_));
+std::shared_ptr<Type> const& TransformFunction::source_type() const {

Review Comment:
   Ideally the formatter would just pick one style and stick to it...I think `T 
const&` is cleaner but `const T&` is far more common



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@iceberg.apache.org
For additional commands, e-mail: issues-h...@iceberg.apache.org

Reply via email to