ERROR com.websudos.phantom - Batch too large
<p>I am getting the following error:</p>

<pre><code>22:24:34.419 [run-main-0] DEBUG com.websudos.phantom - Executing query: com.datastax.driver.core.BatchStatement@3f4f5b68
22:24:34.426 [pool-15-thread-3] ERROR com.websudos.phantom - Batch too large
[error] (run-main-0) com.datastax.driver.core.exceptions.InvalidQueryException: Batch too large
com.datastax.driver.core.exceptions.InvalidQueryException: Batch too large
</code></pre>

<p>Have re-run the code and getting this error at the following point each time:</p>

<pre><code>cqlsh&gt; select count(*) from superchain.blocks  limit 1000000;

 count
-------
 51728

(1 rows)

Warnings :
Aggregation query used without partition key
</code></pre>

<p>Thanks in advance for any insights.</p>

<p>+++ UPDATES +++</p>

<p>So the offending code is</p>

<pre><code>//This file is Database.scala
class Database(val keyspace: KeySpaceDef) extends DatabaseImpl(keyspace) {
  def insertBlock(block: Block) = {
  //should note here that have also tried Batch.unlogged to same effect
    Batch.logged
      .add(ChainDatabase.block.insertNewRecord(block))
      .future()
  }

  def insertTransaction(tx: Transaction) = {
  //should note here that have also tried Batch.unlogged to same effect
    Batch.logged
      .add(ChainDatabase.tx.insertNewTransaction(tx))
      .future()
  }

  object block extends BlockTable with keyspace.Connector

  object tx extends TransactionTable with keyspace.Connector


}

object ChainDatabase extends Database(Config.keySpaceDefinition)
</code></pre>

<p>The following shows the inserting functions for Transaction and there is similar code for the Block.</p>

<p>Have tried to follow </p>

<p><a href="https://medium.com/@foundev/cassandra-batch-loading-without-the-batch-keyword-40f00e35e23e#.7zdd0qopv" rel="nofollow">https://medium.com/@foundev/cassandra-batch-loading-without-the-batch-keyword-40f00e35e23e#.7zdd0qopv</a></p>

<p>&amp;&amp;</p>

<p><a href="https://github.com/outworkers/phantom/wiki/Batch-statements" rel="nofollow">https://github.com/outworkers/phantom/wiki/Batch-statements</a></p>

<p>But am still struggling to find an implementation that does not lead to the <code>Batch too large</code> errors.</p>

<pre><code>//This file is Transaction.scala
abstract class TransactionTable extends TransactionColumnFamily with RootConnector {

  override val tableName = "transactions"

  def insertNew(tx: Transaction): Future[ResultSet] = insertNewTransaction(tx).future()

  def insertNewTransaction(tx: Transaction) = {
    insert
      .value(_.txid, tx.txid)
      .value(_.version, tx.version)
      .value(_.locktime, tx.locktime)
      .value(_.vout, tx.vout)
      .value(_.vin, tx.vin)
  }

}
</code></pre>