Skip to content

cursor with different batch-size will return different result #90

@Himan000

Description

@Himan000

Example as https://python-driver-for-arangodb.readthedocs.io/en/master/cursor.html.
There are 5 docs in collection. If iterate cursor with below code:
cursor = db.aql.execute(
'FOR doc IN students FILTER doc.age > @Val RETURN doc',
bind_vars={'val': 17},
batch_size=2,
count=True
)
while cursor.has_more():
item = cursor.next()
print(item)

There result will be correct:
_{'_key': 'Abby', 'age': 22, '_id': 'students/Abby', '_rev': 'Y-w78wW--'}
{'_key': 'John', 'age': 18, '_id': 'students/John', '_rev': '_Y-w78wW--B'}
{'_key': 'Mary', 'age': 21, '_id': 'students/Mary', '_rev': 'Y-w78wa--'}
{'_key': 'Suzy', 'age': 23, '_id': 'students/Suzy', '_rev': '_Y-ysmze--F'}
{'_key': 'Dave', 'age': 20, '_id': 'students/Dave', '_rev': 'Y-ysmze--H'}
But if change from batch_size=2 to batch_size=3, only 4 docs return.
_{'_rev': 'Y-w78wW--', '_key': 'Abby', 'age': 22, '_id': 'students/Abby'}
{'_rev': '_Y-w78wW--B', '_key': 'John', 'age': 18, '_id': 'students/John'}
{'_rev': 'Y-w78wa--', '_key': 'Mary', 'age': 21, '_id': 'students/Mary'}
{'_rev': '_Y-ysmze--F', '_key': 'Suzy', 'age': 23, 'id': 'students/Suzy'}
Could any anyone help this case or is it a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions