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


##########
test/transform_test.cc:
##########
@@ -25,30 +25,48 @@
 #include <gmock/gmock.h>
 #include <gtest/gtest.h>
 
+#include "iceberg/transform/transform_function.h"
+#include "iceberg/type.h"
 #include "iceberg/util/formatter.h"
 
 namespace iceberg {
 
 TEST(TransformTest, TransformFunction) {
-  class TestTransformFunction : public TransformFunction {
-   public:
-    TestTransformFunction() : TransformFunction(TransformType::kUnknown) {}
-    expected<ArrowArray, Error> Transform(const ArrowArray& input) override {
-      return unexpected(
-          Error{.kind = ErrorKind::kNotSupported, .message = "test transform 
function"});
-    }
-  };
-
-  TestTransformFunction transform;
-  EXPECT_EQ(TransformType::kUnknown, transform.transform_type());
-  EXPECT_EQ("unknown", transform.ToString());
-  EXPECT_EQ("unknown", std::format("{}", transform));
+  IdentityTransform transform{std::make_shared<StringType>()};

Review Comment:
   not for this PR but we should consider singleton type instances for common 
types (though maybe sharing a single refcount is actually a net negative)



-- 
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