From 2d055c35b498a59c33e95137376f341817263047 Mon Sep 17 00:00:00 2001 From: Nghia Truong Date: Wed, 10 Mar 2021 14:41:25 -0700 Subject: [PATCH] =?UTF-8?q?Fix=20offset=5Fend=20iterator=20for=20lists=5Fc?= =?UTF-8?q?olumn=5Fview,=20which=20was=20not=20correctl=E2=80=A6=20(#7551)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the `offset_end` iterator in `lists_column_view`. Since the offset column size is one element larger than the number of column rows, the `offset_end` should be computed as `offset_begin() + size() + 1`. This can also be done by `offset_begin() + offsets().size()`. This PR blocks https://github.com/rapidsai/cudf/pull/7528, thus it must be merged before that PR. Authors: - Nghia Truong (@ttnghia) Approvers: - Jake Hemstad (@jrhemstad) - Mike Wilson (@hyperbolic2346) - Vukasin Milovanovic (@vuule) URL: https://github.com/rapidsai/cudf/pull/7551 --- cpp/include/cudf/lists/lists_column_view.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpp/include/cudf/lists/lists_column_view.hpp b/cpp/include/cudf/lists/lists_column_view.hpp index 8cabf5287c8..6c5cfc37eab 100644 --- a/cpp/include/cudf/lists/lists_column_view.hpp +++ b/cpp/include/cudf/lists/lists_column_view.hpp @@ -107,7 +107,7 @@ class lists_column_view : private column_view { * * @return int32_t const* Pointer to one past the last offset */ - offset_iterator offsets_end() const noexcept { return offsets_begin() + size(); } + offset_iterator offsets_end() const noexcept { return offsets_begin() + offsets().size(); } }; /** @} */ // end of group } // namespace cudf