Check if a record exists in a Cassandra table using the Python driver
<p>How can be determined whether a record exists in a table? The way I tried was to do a <code>SELECT</code> query and then count the rows of the <code>ResultSet</code> using the following:</p>

<pre><code>rows = session.execute("SELECT * FROM test_table WHERE id=%s", ([&lt;id_here&gt;]))
if len(rows) == 0:
    print "Does not exist"
</code></pre>

<p>However, <code>ResultSet</code> does not support <code>len</code>. In another answer, they suggest to use <code>SELECT COUNT(*)</code> which in another reference is strongly discouraged. Is there a more standard way to do this? </p>