@@ -28,8 +28,9 @@ cpp2::ScanVertexRequest buildRequest(
28
28
CHECK_EQ (partIds.size (), cursors.size ());
29
29
std::unordered_map<PartitionID, cpp2::ScanCursor> parts;
30
30
for (std::size_t i = 0 ; i < partIds.size (); ++i) {
31
- c.set_has_next (!cursors[i].empty ());
32
- c.set_next_cursor (cursors[i]);
31
+ if (!cursors[i].empty ()) {
32
+ c.set_next_cursor (cursors[i]);
33
+ }
33
34
parts.emplace (partIds[i], c);
34
35
}
35
36
req.set_parts (std::move (parts));
@@ -183,7 +184,7 @@ TEST(ScanVertexTest, CursorTest) {
183
184
184
185
ASSERT_EQ (0 , resp.result .failed_parts .size ());
185
186
checkResponse (*resp.props_ref (), tag, tag.second .size () + 1 /* kVid */ , totalRowCount);
186
- hasNext = resp.get_cursors ().at (partId).get_has_next ();
187
+ hasNext = resp.get_cursors ().at (partId).next_cursor_ref (). has_value ();
187
188
if (hasNext) {
188
189
CHECK (resp.get_cursors ().at (partId).next_cursor_ref ());
189
190
cursor = *resp.get_cursors ().at (partId).next_cursor_ref ();
@@ -209,7 +210,7 @@ TEST(ScanVertexTest, CursorTest) {
209
210
210
211
ASSERT_EQ (0 , resp.result .failed_parts .size ());
211
212
checkResponse (*resp.props_ref (), tag, tag.second .size () + 1 /* kVid */ , totalRowCount);
212
- hasNext = resp.get_cursors ().at (partId).get_has_next ();
213
+ hasNext = resp.get_cursors ().at (partId).next_cursor_ref (). has_value ();
213
214
if (hasNext) {
214
215
CHECK (resp.get_cursors ().at (partId).next_cursor_ref ());
215
216
cursor = *resp.get_cursors ().at (partId).next_cursor_ref ();
0 commit comments