David Capwell created CASSANDRA-17915:
-----------------------------------------
Summary: Confusing error message when using ? with functions
Key: CASSANDRA-17915
URL: https://issues.apache.org/jira/browse/CASSANDRA-17915
Project: Cassandra
Issue Type: Improvement
Components: CQL/Interpreter
Reporter: David Capwell
{code}
INSERT INTO %S (a, b, c) VALUES (? + 1, ?, ?)
{code}
Errors saying
{code}
Ambiguous '+' operation with args ? and 1: use type casts to disambiguate
{code}
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
{code}
CAST( selector AS to_type )
{code}
But this also fails!
{code}
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
{code}
What we have to do is
{code}
INSERT INTO %S (a, b, c) VALUES ((int) ? + 1, ?, ?)
{code}
We should improve the error message to show the expected syntax (or fix CAST to
work in this case).
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]