[ https://issues.apache.org/jira/browse/CASSANDRA-17915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Natnael Adere updated CASSANDRA-17915: -------------------------------------- Status: Patch Available (was: In Progress) Patch: [trunk|https://github.com/apache/cassandra/pull/1957] , [4.0|https://github.com/apache/cassandra/pull/1928] , [4.1|https://github.com/apache/cassandra/pull/1929] Circle CI: [trunk|https://app.circleci.com/pipelines/github/NateAdere/cassandra?branch=Cassandra-17915-trun] , [4.0|https://app.circleci.com/pipelines/github/NateAdere/cassandra?branch=Cassandra-17915-4.0] , [4.1|https://app.circleci.com/pipelines/github/NateAdere/cassandra?branch=Cassandra-17915-4.1] > 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 > Assignee: Natnael Adere > Priority: Normal > Fix For: 4.0.x, 4.1.x > > Time Spent: 1h 10m > Remaining Estimate: 0h > > {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