Like question says, is there a way to obtain some data on the record in the batch that threw an error?
Let's say I have a table of:
CREATE TABLE myspace.tableA (
columnA text,
columnB text,
PRIMARY KEY((columnA))
)
and then I create a batch like this:
INSERT INTO tableA (columnA, columnB) VALUES ("a1", "b1")
INSERT INTO tableA (columnA, columnB) VALUES ("a2", "b2")
...
INSERT INTO tableA (columnA, columnB) VALUES ("ax", 1234565789)
...
INSERT INTO tableA (columnA, columnB) VALUES ("a100", "b100")
and my GO code is:
batch := session.NewBatch(gocql.LoggedBatch)
for i := 0; i < 100; i++ {
batch.Query(INSERT_TABLE_A, columnA, columnB)
}
err := session.ExecuteBatch(batch)
if err != nil {
llog.Errorf("Batch error: %+v", observedBatch.obError)
}
all I can get in that error "Batch error: can not marshal int into varchar", but it does not tell me where in the batch the error occurred. Is there a way for me to obtain an index or the statement that failed, or any type of clear message?
P.S. this example is pretty simple, but I am trying to solve for more complex cases where issues might not be as obvious.