jorisvandenbossche commented on code in PR #35036:
URL: https://github.com/apache/arrow/pull/35036#discussion_r1196486183


##########
cpp/src/arrow/array/data.cc:
##########
@@ -430,8 +443,17 @@ void ArraySpan::FillFromScalar(const Scalar& value) {
     const auto& scalar = checked_cast<const RunEndEncodedScalar&>(value);
     this->child_data.resize(2);
     auto& run_end_type = scalar.run_end_type();
-    auto run_end = MakeScalar(run_end_type, 1).ValueOrDie();
-    this->child_data[0].FillFromScalar(*run_end);
+    switch (run_end_type->id()) {
+      case Type::INT16:
+        SetRunForScalar<Int16Type>(this, run_end_type, this->scratch_space);
+        break;
+      case Type::INT32:
+        SetRunForScalar<Int32Type>(this, run_end_type, this->scratch_space);
+        break;
+      default:
+        DCHECK_EQ(run_end_type->id(), Type::INT64);
+        SetRunForScalar<Int64Type>(this, run_end_type, this->scratch_space);

Review Comment:
   > You're getting that stack trace you posted above from this new 
implementation?
   
   No, that was with the previous implementation. This last commit was to fix 
that



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

Reply via email to