firebrand icon indicating copy to clipboard operation
firebrand copied to clipboard

Some problem with INSERT execute query, With set<int>.

Open americanblond opened this issue 10 years ago • 0 comments

Hi,

I catched some strange exception when try to execute query, using firebrand.

I created table like this:

CREATE TABLE "LiveScoreSubscription" ("key" text PRIMARY KEY, "___class" text, "userId" text, "sportId" int, "leagueId" int, "eventGroupId" int, "scores" bigint, "scoresSet" set int);

And try to execute query via CQLSH like this:

INSERT INTO "LiveScoreSubscription" (key, "___class", "userId", "sportId", "leagueId", "eventGroupId", "scores", "scoresSet") VALUES ('1155668877', 'rdgdr', 'bz_halyna',4, 13, 35, 3321, {5,10,15});

And it works for me fine.

But when i tried to execude this query from my code like this:

"INSERT INTO LiveScoreSubscription ('key', '___class', 'userId', 'sportId', 'leagueId', 'eventGroupId', 'scores', 'scoresSet') VALUES (':key', ':class', ':userId',':sportId', ':leagueId', ':eventGroupId', ':scores', ':scoresSet');"

...

Set<Integer> scoresSet = {1,2,3};

I catched that strange Exception:

13:04:19,356 ERROR stderr Caused by: cns.exceptions.DAOException: me.prettyprint.hector.api.exceptions.HInvalidRequestException: InvalidRequestException(why:cannot parse '{ 1,2,3}' as hex bytes)

Can you help me please?

americanblond avatar Aug 20 '14 10:08 americanblond