Skip to content

BatchQuery serializes batch to string instead of using BatchStatement #208

@Lorak-mmk

Description

@Lorak-mmk

In the cqlengine, there is BatchQuery class -

class BatchQuery(object):
- which can be used as a context manager and with other cqlengine constructs.
For some reason, in it's execute method it serializes whole batch to the string - instead of using BatchStatement
class BatchStatement(Statement):
which is a protocol-level batch.
This is 1. bad in terms of performance 2. causes other issues - e.g. here
is_batch_statement = isinstance(self.response_future.query, BatchStatement)
the driver checks if query is a batch by checking if it's a subclass of BatchStatement - and queries created with BatchQuery obviously won't.

Unless there is some fundamental reason for this behavior, we should fix it.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestupstream-issueIssue is not specific to our fork and Scylla and should be also fixed in the upstream

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions