diff --git a/core/src/main/java/com/yugabyte/oss/driver/internal/core/loadbalancing/PartitionAwarePolicy.java b/core/src/main/java/com/yugabyte/oss/driver/internal/core/loadbalancing/PartitionAwarePolicy.java index d535da646ad..c5108a701e0 100644 --- a/core/src/main/java/com/yugabyte/oss/driver/internal/core/loadbalancing/PartitionAwarePolicy.java +++ b/core/src/main/java/com/yugabyte/oss/driver/internal/core/loadbalancing/PartitionAwarePolicy.java @@ -142,6 +142,9 @@ private Iterator getQueryPlan(Session session, BatchStatement batch) { while (batchIterator.hasNext()) { BatchableStatement nextStatement = batchIterator.next(); if (nextStatement instanceof BoundStatement) { + if (batch.getConsistencyLevel() != null && nextStatement.getConsistencyLevel() == null) { + nextStatement = nextStatement.setConsistencyLevel(batch.getConsistencyLevel()); + } Iterator plan = getQueryPlan(session, (BoundStatement) nextStatement); if (plan != null) return plan; }