[
https://issues.apache.org/jira/browse/ARROW-1735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16268030#comment-16268030
]
ASF GitHub Bot commented on ARROW-1735:
---------------------------------------
wesm closed pull request #1368: ARROW-1735: [C++] Add test sliced Array cast
URL: https://github.com/apache/arrow/pull/1368
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/cpp/src/arrow/compute/compute-test.cc
b/cpp/src/arrow/compute/compute-test.cc
index 61d53c4d5..7949bb99c 100644
--- a/cpp/src/arrow/compute/compute-test.cc
+++ b/cpp/src/arrow/compute/compute-test.cc
@@ -69,6 +69,11 @@ class TestCast : public ComputeFixture, public TestBase {
std::shared_ptr<Array> result;
ASSERT_OK(Cast(&ctx_, input, out_type, options, &result));
ASSERT_ARRAYS_EQUAL(expected, *result);
+
+ std::shared_ptr<Array> result_sliced;
+ int64_t offset = input.length()/2;
+ ASSERT_OK(Cast(&ctx_, *input.Slice(offset), out_type, options,
&result_sliced));
+ ASSERT_ARRAYS_EQUAL(*expected.Slice(offset), *result_sliced);
}
template <typename InType, typename I_TYPE>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [C++] Cast kernels cannot write into sliced output array
> --------------------------------------------------------
>
> Key: ARROW-1735
> URL: https://issues.apache.org/jira/browse/ARROW-1735
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++
> Reporter: Wes McKinney
> Assignee: Wes McKinney
> Labels: pull-request-available
> Fix For: 0.8.0
>
>
> If the offset is non-zero, the results will be written into the wrong
> location:
> https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/cast.cc#L218
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)