I am trying to run the following command in cqlsh:

cqlsh:testreducedb> INSERT INTO commits (hash, tid, keyframe) VALUES (0b5db8b91bfdeb0a304b372dd8dda123b3fd1ab6, now(), true);

I am guessing that I am getting an error because the column hash is of type blob but I am trying to insert that commit hash 0b5db8b91bfdeb0a304b372dd8dda123b3fd1ab6.

How do you insert this in cqlsh?

Also I am getting the following error when running that command:

Bad Request: line 1:63 mismatched character '1' expecting '-'

Not very helpful to me, don't really know how to deal with it.

有帮助吗?

解决方案

The blob literal must be started with "0x"

INSERT INTO commits (hash, tid, keyframe) VALUES (0x0b5db8b91bfdeb0a304b372dd8dda123b3fd1ab6, now(), true);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top