Skip to content

Commit

Permalink
Add debug log for Cassandra query
Browse files Browse the repository at this point in the history
  • Loading branch information
ebyhr committed Jul 22, 2020
1 parent e533c3a commit a6e01fc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ public List<CassandraPartition> getPartitions(CassandraTable table, List<Set<Obj

public ResultSet execute(String cql)
{
log.debug("Execute cql: %s", cql);
return executeWithSession(session -> session.execute(cql));
}

public PreparedStatement prepare(RegularStatement statement)
{
log.debug("Execute RegularStatement: %s", statement);
return executeWithSession(session -> session.prepare(statement));
}

Expand All @@ -449,6 +451,7 @@ private Iterable<Row> queryPartitionKeysWithInClauses(CassandraTable table, List
Select partitionKeys = selectDistinctFrom(tableHandle, partitionKeyColumns);
addWhereInClauses(partitionKeys.where(), partitionKeyColumns, filterPrefixes);

log.debug("Execute cql for partition keys with IN clauses: %s", partitionKeys);
return execute(partitionKeys).all();
}

Expand All @@ -464,6 +467,7 @@ private Iterable<Row> queryPartitionKeysLegacyWithMultipleQueries(CassandraTable
Select partitionKeys = selectDistinctFrom(tableHandle, partitionKeyColumns);
addWhereClause(partitionKeys.where(), partitionKeyColumns, combination);

log.debug("Execute cql for partition keys with multiple queries: %s", partitionKeys);
List<Row> resultRows = execute(partitionKeys).all();
if (resultRows != null && !resultRows.isEmpty()) {
rowList.addAll(resultRows);
Expand Down

0 comments on commit a6e01fc

Please sign in to comment.