Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
-
Operability
-
Low Hanging Fruit
-
All
-
None
-
Description
INSERT INTO %S (a, b, c) VALUES (? + 1, ?, ?)
Errors saying
Ambiguous '+' operation with args ? and 1: use type casts to disambiguate
Now, if you google “type casts CQL” you get https://docs.datastax.com/en/dse/5.1/cql/cql/cql_reference/refCqlFunction.html which says to do
CAST( selector AS to_type )
But this also fails!
InvalidRequestException: Ambiguous call to function system.castAsFloat (can be matched by following signatures: system."castAsFloat" : (bigint) -> float, system."castAsFloat" : (counter) -> float, system."castAsFloat" : (double) -> float, system."castAsFloat" : (int) -> float, system."castAsFloat" : (tinyint) -> float, system."castAsFloat" : (varint) -> float, system."castAsFloat" : (decimal) -> float, system."castAsFloat" : (smallint) -> float): use type casts to disambiguate
What we have to do is
INSERT INTO %S (a, b, c) VALUES ((int) ? + 1, ?, ?)
We should improve the error message to show the expected syntax (or fix CAST to work in this case).
Attachments
Issue Links
- links to