zhjwpku commented on code in PR #156:
URL: https://github.com/apache/iceberg-cpp/pull/156#discussion_r2264199334


##########
src/iceberg/transform_function.cc:
##########
@@ -176,11 +318,39 @@ Result<std::unique_ptr<TransformFunction>> 
MonthTransform::Make(
 DayTransform::DayTransform(std::shared_ptr<Type> const& source_type)
     : TransformFunction(TransformType::kDay, source_type) {}
 
-Result<ArrowArray> DayTransform::Transform(const ArrowArray& input) {
-  return NotImplemented("DayTransform::Transform");
+Result<Literal> DayTransform::Transform(const Literal& literal) {
+  assert(literal.type() == source_type());
+  if (literal.IsBelowMin() || literal.IsAboveMax()) {
+    return InvalidArgument(
+        "Cannot apply day transform to literal with value {} of type {}",
+        literal.ToString(), source_type()->ToString());
+  }
+  if (literal.IsNull()) [[unlikely]] {
+    return Literal::Null(iceberg::int32());

Review Comment:
   Ah, my oversight, updated to `int` and adjusted the corresponding test case.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to