Is there a way to apply a loop in cql file cassandra?
<p>I have to run the following insert query 1000 times in BATCH just after loading a schema.</p>

<pre><code>INSERT INTO keyspace.messages (messageid, message) VALUES
(uuid(), 'random');
</code></pre>

<p>My current implementation is a <code>radom.cql</code> file, which has 1000 entries like the script below. And then I use SOURCE command to apply them after my schema upload.</p>

<pre><code>BEGIN BATCH
INSERT INTO keyspace.messages (messageid, message) VALUES (uuid(), 'random');
INSERT INTO keyspace.messages (messageid, message) VALUES (uuid(), 'random');
INSERT INTO keyspace.messages (messageid, message) VALUES (uuid(), 'random');
...till 1000 times
APPLY BATCH;
</code></pre>

<p>Is there any better way to achieve the same result?</p>