[ https://issues.apache.org/jira/browse/CASSANDRA-17915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17608141#comment-17608141 ]
Benjamin Lerer commented on CASSANDRA-17915: -------------------------------------------- The error message is unclear and should be changed to 'use type hints to disambiguate'. > 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 > Priority: Normal > > {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: commits-unsubscr...@cassandra.apache.org For additional commands, e-mail: commits-h...@cassandra.apache.org