c-jamie commented on a change in pull request #7635:
URL: https://github.com/apache/arrow/pull/7635#discussion_r450986449
##########
File path: cpp/src/arrow/compute/api_scalar.cc
##########
@@ -126,5 +126,24 @@ Result<Datum> Compare(const Datum& left, const Datum&
right, CompareOptions opti
SCALAR_EAGER_UNARY(IsValid, "is_valid")
SCALAR_EAGER_UNARY(IsNull, "is_null")
+Result<Datum> FillNull(const Datum& values, const Datum& fill_value,
ExecContext* ctx) {
+ if (!values.is_arraylike()) {
+ return Status::Invalid("Values must be Array or ChunkedArray");
+ }
+
+ if (!fill_value.is_scalar()) {
+ return Status::Invalid("fill value must be a scalar");
+ }
+
+ if (!values.type()->Equals(fill_value.type())) {
+ std::stringstream ss;
+ ss << "Array type didn't match type of fill value: " <<
values.type()->ToString()
+ << " vs " << fill_value.type()->ToString();
+ return Status::Invalid(ss.str());
+ }
Review comment:
This has been reworked
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]